Created
January 10, 2023 11:14
-
-
Save wotjd/d3ce8de43e0f7d4c02af7b9d4926c17d 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 AProtocol { | |
func callAsFunction() | |
} | |
class AClass: AProtocol { | |
func callAsFunction() { print("hi there") } | |
} | |
let a: any AProtocol = AClass() | |
a() // prints "hi there" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment