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
But now both Xcode and the repl report this error when trying to call tc.p1(a:2):
error: cannotcallvalueofnon-functiontype'Int'
When compiled with swiftc (even a recent june 3.0-dev) the code above still gets compiled cleanly without errors.
Since i suppose that we now want to disallow the use of the same name for a method and a property, this check should be performed in swiftc too and maybe the error should be shown when the class with the duplicated label it's declared (when the p1 func is declared?) instead than at its first use.
Note: And the `p1` function can still be called with (tc.p1 as (Int)->Void)(2), so, it this just an initial implementation of this error or it's the side-effect of other modifications in the way types are handled/resolved?
The text was updated successfully, but these errors were encountered:
With the addition of first(where: ) to Array/Collection/Sequence in Swift 3, this issue has been exacerbated— it now can occur in code with only routine standard library usage.
“Name your properties and methods differently” is no longer a viable workaround. I hope this might raise the severity/priority of this bug.
Additional Detail from JIRA
md5: fef16d35fd5d9c5fe9be8e350257d666
relates to:
Issue Description:
Until Swift 2.2.1 this snippet compiled correctly and no errors were reported by SourceKit:
But now both Xcode and the repl report this error when trying to call tc.p1(a:2):
When compiled with swiftc (even a recent june 3.0-dev) the code above still gets compiled cleanly without errors.
Since i suppose that we now want to disallow the use of the same name for a method and a property, this check should be performed in swiftc too and maybe the error should be shown when the class with the duplicated label it's declared (when the p1 func is declared?) instead than at its first use.
Note: And the `p1` function can still be called with (tc.p1 as (Int)->Void)(2), so, it this just an initial implementation of this error or it's the side-effect of other modifications in the way types are handled/resolved?
The text was updated successfully, but these errors were encountered: