[SR-726] Can't access associated types through class-constrained generic parameters #43341
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Additional Detail from JIRA
md5: 28453193dbd999bd7c7c32caa1cb0e83
Issue Description:
Given a protocol P with an associated type A, a class C conforming to P and a function f with an generic parameter T constrained to C, it is not possible to access A through through T (
T.A
) inside the body of f.In the function signature though,
T.A
works as expected (for example as a return type).Example:
Compiler output:
The text was updated successfully, but these errors were encountered: