Generics: Pointer after identifier

Description

genericTypeSpecifier:
identifier pointer? (
LT (protocolList | typeSpecifierList) GT
)?;

Is it possible to have MyGeneric*<somth...> ? What the type does describe?

Environment

None

Activity

Show:
Alex Petuschak
October 21, 2020, 9:56 AM

Generics in Objective-C work close to C++ generics.

Sample:

NSArray is the base type and NSString is the template type.

The Swift equivalent would be [String].

Serhii Kuzmychov
October 21, 2020, 12:05 PM

no I told about the case:
- (NSArray*<NSString *> *)myMethod;

I think it is has no sense

Alex Petuschak
October 21, 2020, 1:00 PM

This won’t compile in Xcode: https://take.ms/jejDU.

Not sure where did you find this code.

Assignee

Serhii Kuzmychov

Reporter

Serhii Kuzmychov

Labels

None

Git Branch Name

None

GitHub Issue

None

Fix versions

Priority

Medium
Configure