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
Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 6e4f61c)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: fbc1db1ee131fe26d1687a21de8dd692
relates to:
SR-525 AnyObject unresolved dot expr fails oddly and intermittently
Issue Description:
Description:
If a property is defined in another file in the current module, the compiler appears to be unwilling to resolve an unresolved dot expression on an AnyObject instance to refer to that property.
Interesting, this is not a bug. Dynamic lookup will not find Foo.property unless you expose it to Objective-C with @objc—inheriting from NSObject does not count. The property it finds when you place everything in a single file is Foundation.Stream.property(forKey:), and the reason this fails in the original example is because you forgot to import Foundation in main.swift.
Environment
Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 6e4f61c)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: fbc1db1ee131fe26d1687a21de8dd692
relates to:
Issue Description:
Description:
If a property is defined in another file in the current module, the compiler appears to be unwilling to resolve an unresolved dot expression on an AnyObject instance to refer to that property.
Sample Case:
File main.swift
File Bug.swift
Run command, with appropriate SDKROOT set.
Expected result: compilation with no errors.
Actual result:
If all the code is stored in the same file, this works okay.
The text was updated successfully, but these errors were encountered: