Skip to content

[SR-2792] Bad diagnostic attempting to use typealias in protocol #45396

@ddunbar

Description

@ddunbar
Previous ID SR-2792
Radar None
Original Reporter @ddunbar
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee @slavapestov
Priority Medium

md5: 973fc691a7ee13b82cbb06954e89cfda

Issue Description:

This diagnostic is unfortunate:

$ cat z.swift 
protocol P {
    typealias Thing = Int
}

struct S: P {
    let x = Thing(1)
}

$ swiftc -c z.swift 
z.swift:6:13: error: use of unresolved identifier 'Thing'
    let x = Thing(1)
            ^~~~~
z.swift:2:15: note: did you mean 'Thing'?
    typealias Thing = Int
              ^

... I did Swift, I did.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions