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
has no label and is naively calling the first function because it returns optional (but writer of this code forgot about the label)
Since the operator ?? can be used when left value is non-optional this is complete valid expression, but there should be at least warning for that case, right?
The text was updated successfully, but these errors were encountered:
I think you meant "naively calling the second function". @jopamer, here's an example of where "implicit conversion to optional from non-optional" is a problem!
(We could also warn on infinite recursion, like Clang does, but that wouldn't catch all instances of this mistake—say, within the body of an if statement.)
Environment
OS X: 10.11.4 Beta (15E33e)
Swift 2.1.1 (Xcode 7.2.1 (7C1002)) and also in 2.2 (Xcode 7.3 beta (7D129n))
Additional Detail from JIRA
md5: 80de1a1ee66b648a64a4bc5c1d474510
relates to:
Issue Description:
I found pretty weird bug in this example code:
This code is causing infinite loop because
first function
has label for first argument
second function
has no label and is naively calling the first function because it returns optional (but writer of this code forgot about the label)
Since the operator ?? can be used when left value is non-optional this is complete valid expression, but there should be at least warning for that case, right?
The text was updated successfully, but these errors were encountered: