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
SR-826 Conditional compilation over methods seem to do syntax check but only a simple one
Issue Description:
Overloading a method seems to break when using a build configuration (and the build configuration is NOT defined). In the following code the SCOOBY_DOO command line flag was not passed:
main.swift:11:8: error: definition conflicts with previous value
func log(responseData: NSData) {
^
main.swift:7:8: note: previous definition of 'log' is here
func log(urlRequest: NSURLRequest) {
^
main.swift:15:8: error: definition conflicts with previous value
func log(error: NSError) {
^
main.swift:7:8: note: previous definition of 'log' is here
func log(urlRequest: NSURLRequest) {
^
Note that if SCOOBY_DOO is defined, then the code compiles. Also, this works in either case if these methods are not inside of a type and simply top level functions. It also works if you individually wrap each overloaded method with the build configuration flag like this:
Additional Detail from JIRA
md5: 1d9231862676d4fba1627315856a860b
duplicates:
Issue Description:
Overloading a method seems to break when using a build configuration (and the build configuration is NOT defined). In the following code the SCOOBY_DOO command line flag was not passed:
The code fails with:
Note that if SCOOBY_DOO is defined, then the code compiles. Also, this works in either case if these methods are not inside of a type and simply top level functions. It also works if you individually wrap each overloaded method with the build configuration flag like this:
The text was updated successfully, but these errors were encountered: