swiftlang/swift

[SR-8797] Misleading compiler errors

Open

#51.305 aperta il 19 set 2018

Vedi su GitHub
 (7 commenti) (0 reazioni) (0 assegnatari)Swift (10.719 fork)batch import
bugcompilerdiagnostics qualitygood first issuetype checker

Metriche repository

Star
 (69.989 star)
Metriche merge PR
 (Merge medio 8g 17h) (510 PR mergiate in 30 g)

Descrizione

Previous ID SR-8797
Radar rdar://problem/44616337
Original Reporter @jeremyabannister
Type Bug
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug, TypeChecker
Assignee None
Priority Medium

md5: f2dc6c9ca2ac0b74c004d15fc50e5a7b

Issue Description:

typealias Executable <Input> = (Input)->()
let test: Executable<Void>? = { }

The code above leads to the error:

Cannot convert value of type '() -> ()' to specified type '((Void) -> ())?'

Whereas this code compiles successfully:

typealias Executable <Input> = (Input)->()
let test: Executable<Void>? = { _ in }

Guida contributor