Skip to content

Instantly share code, notes, and snippets.

@toshi0383
Created November 11, 2015 11:39
Show Gist options
  • Select an option

  • Save toshi0383/11ed76bd5ee891676e68 to your computer and use it in GitHub Desktop.

Select an option

Save toshi0383/11ed76bd5ee891676e68 to your computer and use it in GitHub Desktop.
先ほどの関数引数のT->SクロージャのTが反変であることのデモコードになります。 #cm_ios9 #CodePiece
func test2(b:(Int) -> Any) {
}
test2 {(a:Int) in
return 0
}
test2 {(a:Any) in // <= does compile
return 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment