[SR-609] 'Cannot call value of non-function type' error when calling initializer of class with same name as enum case #43226
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Attachment: Download
Environment
OS X 10.11.3 (15D21)
Xcode 7.2 (7C68)
Swift 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81)
Additional Detail from JIRA
md5: 78af40aa7804f90ffce679e3c44e0652
duplicates:
Issue Description:
When a class uses the same name as an enum case, you can't call the initializer of the class from a function on the enum anymore, because the compiler is confused and shows an 'Cannot call value of non-function type' error.
e.g.:
I guess some people would consider this a bad naming scheme anyway. But since Swift uses namespaces so we don't need to prefix names like in Objective C anymore, i think this should be treated as a bug.
The text was updated successfully, but these errors were encountered: