You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
beccadax opened this issue
Mar 27, 2017
· 0 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfSILGenArea → compiler: The SIL generation stage
Swift 4 at commit bf1791b (based on master commit 70f3d93), macOS 10.12.3 (16D32), Xcode 8.3 beta 4 (8W143q)
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug, SILGen
Assignee
None
Priority
Medium
md5: 1ddb2f0a67bdb030ed22f416d3bdef3c
Issue Description:
When compiling this file:
// Does not have to be a function; I first saw this with String(reflecting:).functake(_: CustomStringConvertible) {}
// Must be in a function.funcwat() {
// Must be an existential; Any works too.letvalue: CustomStringConvertible// Must be initialized on a separate line.value = "x"// Must be in a closure and must be immediately called.
({ take(value) })()
}
Swift 4, with PR #8366 applied to avoid a crash, complains:
This is at least better than Swift 3.1, which goes into an infinite loop. (That's with the parentheses around the closure; without them, it mis-parses the expression entirely.)
Examining the SIL, it looks like something decides that `value` needs to be passed to `take(_🙂` as `@lvalue_aliasable`, and the DI lifetime checker accurately complains that you can't do that to a `let` variable.
The text was updated successfully, but these errors were encountered:
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfSILGenArea → compiler: The SIL generation stage
Attachment: Download
Environment
Swift 4 at commit bf1791b (based on master commit 70f3d93), macOS 10.12.3 (16D32), Xcode 8.3 beta 4 (8W143q)
Additional Detail from JIRA
md5: 1ddb2f0a67bdb030ed22f416d3bdef3c
Issue Description:
When compiling this file:
Swift 4, with PR #8366 applied to avoid a crash, complains:
This is at least better than Swift 3.1, which goes into an infinite loop. (That's with the parentheses around the closure; without them, it mis-parses the expression entirely.)
Examining the SIL, it looks like something decides that `value` needs to be passed to `take(_🙂` as `@lvalue_aliasable`, and the DI lifetime checker accurately complains that you can't do that to a `let` variable.
The text was updated successfully, but these errors were encountered: