Last active
August 29, 2015 14:25
-
-
Save 335g/607bb9ae597405da050c to your computer and use it in GitHub Desktop.
引数のタプル受け取りはジェネリクス使った関数だとNG
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
/// Xcode7 beta4 | |
struct MyInt { | |
var a: Int | |
} | |
struct MyGenerics<T> { | |
var a: T | |
} | |
func func1(a: MyInt, _ b: Int) {} | |
func func2(a: MyGenerics<Int>, _ b: Int) {} | |
func func3<T>(a: MyGenerics<T>, _ b: Int) {} | |
let t1: (MyInt, Int) = (MyInt(a: 0), 0) | |
let t2: (MyGenerics<Int>, Int) = (MyGenerics(a: 0), 0) | |
func1(t1) // OK | |
func2(t2) // OK | |
func3(t2) // NG | |
let func4: (MyGenerics<Int>, Int) -> () = func3 | |
func4(t2) // OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment