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
macOS 10.13, Xcode 10, 4.2 development snapshot Aug 21
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: 88ea6baea7bf50eddae0a1b4359f3b57
duplicates:
SR-1772 File-level function with the same name as instance function not picked up by compiler
Issue Description:
Please, see the following example:
enum FooType {
case foo1
case foo2
}
class Foo {
func printClassName() {
print(NSStringFromClass(type(of: self)))
}
var type: FooType {
return .foo1
}
}
type(of: self) is marked with error cannot call value of non-function type 'FooType' which is obviously wrong as I'm calling type(of🙂, not self.type. The obvious solution is to use Swift.type(of🙂, but for a person that always uses the explicit self, this is not a nice solution. Though not sure what the correct solution would be here - probably to also include the global namespace in the lookup?
The text was updated successfully, but these errors were encountered:
Environment
macOS 10.13, Xcode 10, 4.2 development snapshot Aug 21
Additional Detail from JIRA
md5: 88ea6baea7bf50eddae0a1b4359f3b57
duplicates:
Issue Description:
Please, see the following example:
type(of: self)
is marked with errorcannot call value of non-function type 'FooType'
which is obviously wrong as I'm callingtype(of🙂
, notself.type
. The obvious solution is to useSwift.type(of🙂
, but for a person that always uses the explicitself
, this is not a nice solution. Though not sure what the correct solution would be here - probably to also include the global namespace in the lookup?The text was updated successfully, but these errors were encountered: