[SR-6725] @autoclosure causes ambiguity warnings that can be fixed by wrapping in identity function #49274
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
Attachment: Download
Environment
Additional Detail from JIRA
md5: 7b0d8a53ec125efb1af7dad400438ba5
Issue Description:
The following code
should just print
42
but unfortunately it doesn't compile:Adding more type annotations also doesn't seem to help.
However, just wrapping the
@autoclosure
valuevalue
in the identity functionid
makes it compile. That's surprising 🙂compiler is the latest 4.1 snapshot but the same problem exists in 4.0 (and 3.1).
The text was updated successfully, but these errors were encountered: