-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
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 itselftype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Previous ID | SR-168 |
Radar | None |
Original Reporter | nikita (JIRA User) |
Type | Bug |
Environment
Xcode 7.2 (7C68)
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, TypeChecker |
Assignee | None |
Priority | Medium |
md5: eb1b8c6f0b081ea09744c1503d1588d0
Issue Description:
In case function that takes closure require type inference resolution and it is called in a context where type can not be inferred compiler reports a wrong error. For example:
func a<T>(b: ()->()) -> T.Type {
return T.self
}
let c = a {
print("")
}
This code reports following error:
error: ambiguous reference to member 'print'
commenting out print cause a proper error:
error: generic parameter 'T' could not be inferred
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 itselftype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis