Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name lookup of typealias in protocol inconsistent for nested types #72461

Open
benpious opened this issue Mar 20, 2024 · 0 comments
Open

Name lookup of typealias in protocol inconsistent for nested types #72461

benpious opened this issue Mar 20, 2024 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@benpious
Copy link
Contributor

Description

A typealias is respected for the initializer of a type, but not the type annotation, when it is nested in a protocol.

Reproduction

protocol P {
    
}

extension P {
    
    typealias UUID = Int
    
}

struct S: P {
    
    var uuid: UUID = UUID()
        
}

Expected behavior

This should compile; the meaning of UUID should have changed in both locations.

Environment

Swift 5.9, Xcode 15.3.

Additional information

No response

@benpious benpious added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant