Overloading function inside #if os(iOS) block cause build fail for OS X build on Xcode 6.3 (6D570)
| Originator: | Norio.Nomura | ||
| Number: | rdar://20478766 | Date Originated: | 2015/04/09 |
| Status: | Open | Resolved: | |
| Product: | Xcode 6.3 (6D570) | Product Version: | |
| Classification: | Reproducible: | Always |
Overloading function inside #if os(iOS) block cause build fail for OS X build.
```
class IfOS {
#if os(iOS)
func request(domain: String?) { // note: previous definition of 'request' is here
request(domain!)
}
func request(domain: String) { // error: definition conflicts with previous value
_request(domain, account: "test")
}
func _request(domain: String, account: String) {
}
#endif
}
```
Steps to Reproduce:
1. Create OS X Playground
2. Paste following code:
```
class IfOS {
#if os(iOS)
func request(domain: String?) { // note: previous definition of 'request' is here
request(domain!)
}
func request(domain: String) { // error: definition conflicts with previous value
_request(domain, account: "test")
}
func _request(domain: String, account: String) {
}
#endif
}
```
Expected Results:
no error was shown.
Actual Results:
"error: definition conflicts with previous value" was shown on step 2
Version:
Xcode 6.3 (6D570) & OS X 10.10.3 (14D131)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!