-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: types
Description
| Previous ID | SR-9501 |
| Radar | None |
| Original Reporter | @AnthonyLatsis |
| Type | Bug |
| Status | Resolved |
| Resolution | Duplicate |
Environment
Xcode 10.1 (10B61) & master
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: 075e0f26634a1fe1f91a9305b41c2dac
duplicates:
Issue Description:
This is a variation of SR-4758 that I believe should be faced separately. Here, the associated type is known to be concrete through a type alias in the class component of a subclass existential (rather than through where clauses on protocol declarations that directly constraint an assoc. type).
class Class {
typealias Assoc = Int
}
protocol Proto {
associatedtype Assoc
}
func foo(arg: Class & Proto) {} // protocol 'Proto' can only be used as a generic constraint because it has Self or associated type requirements.Metadata
Metadata
Assignees
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: types