-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationtype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
The following fails to produce a diagnostic:
protocol P {}
func bar<T>(_ x: T) -> T.Type {}
func foo(_ x: P.Type) { }
foo(bar(0)) // error: failed to produce diagnostic for expression; please submit a bug report
It ought to produce the same diagnostic as:
foo(Int.self) // error: cannot convert value of type 'Int.Type' to expected argument type 'any P.Type'
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationtype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis