[SR-13376] Property wrapper typealias defined in protocol-extension is not resolved correctly. #55816
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
property wrappers
Feature: property wrappers
type checker
Area → compiler: Semantic analysis
Environment
Big Sur developer beta 4
Xcode 12 beta 4
Swift 5.3
Additional Detail from JIRA
md5: 0e20853ceeffae474ce696885650b09f
Issue Description:
The example below demonstrates the bug. Here, Bar is used both as a top-level name for a protocol, and a name for a typealias to a property wrapper (defined in a protocol extension).
When using property wrappers, the Bar typealias is expected to resolve to the property wrapper but instead it resolves to the top-level protocol.
In the following example, "x0" will not compile while "x1" will - even though they semantically point to the same property wrapper.
protocol Bar {
{{ }}
{{}}}
{{ }}
@propertyWrapper
struct Baz: Bar {
{{ var wrappedValue: Void}}
{{ }}
{{ init() {}}
{{ wrappedValue = ()}}
{{}}}
{{ }}
protocol FooProtocol {
{{ }}
{{}}}
{{ }}
extension FooProtocol {
{{ typealias Bar = Baz}}
{{ typealias BarNonConflictingName = Baz}}
{{}}}
{{ }}
struct Foo: FooProtocol {
{{ @bar var x0: Void}}
{{ @BarNonConflictingName var x1: Void}}
{{}}}
The text was updated successfully, but these errors were encountered: