[SR-4309] Type inferring fails in expression with ?? and + #46892
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Environment
Xcode 8.2.1
Additional Detail from JIRA
md5: 1ded587e498b0edd7ce2ef020c1cb6c2
blocks:
Issue Description:
See the following example of a rather simple class:
The expression:
fails to compile with
Cannot convert value of type '[T]?' to expected argument of type '[_]'
The workarounds are obvious. Simplifying the expression using variables,adding additional parenthesis or adding a
as [T]?
cast.An interesting case is when we remove the generic:
will fail with
Ambigious reference to member '??'
Considering all the types are well defined, there should be no room for ambiguity.
The text was updated successfully, but these errors were encountered: