Last active
December 31, 2015 21:36
-
-
Save chris-hatton/7fe327d8af46d4b37f6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ProtocolA {} | |
protocol ProtocolB {} | |
func overloadingTest ( obj: String ) -> String | |
{ | |
return "It's a String" | |
} | |
func overloadingTest ( obj: Int ) -> String // This compiles fine, and the appropriate 'topLevelTest' function is called | |
{ | |
return "It's an Int" | |
} | |
func aFunction() | |
{ | |
func nestedOverloadingTest ( obj: String ) -> String | |
{ | |
return "It's a String" | |
} | |
func nestedOverloadingTest ( obj: Int ) -> String // Fails to compile with 'Definition conflicts with previous value' | |
{ | |
return "It's an Int" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment