Extensions to protocol typealias types compile but can't be accessed #61450
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
type checker
Area → compiler: Semantic analysis
Describe the bug
If I declare a typealias for a concrete type in a protocol, e.g.
and then I write an extension based on that typealias on a conforming type, e.g.:
The compiler allows it. But trying to access the extension property will fail:
If I declare the extension directly on the type (not through the typealias), e.g.
Then the same print statement (accessing type A through the protocol typealias) will succeed
Declaring the typealias directly on the type allows the extension through the typealias to work:
It only seems to fail on the requirement of writing an extension that refers to a typealias declared by a protocol.
Environment (please fill out the following information)
Additional context
Ultimately what I want to accomplish is something like this (just a convenience really)
Swift Forums thread here
The text was updated successfully, but these errors were encountered: