Skip to content

Instantly share code, notes, and snippets.

@tarunon
Last active March 31, 2017 04:55
Show Gist options
  • Save tarunon/b653d9326f1196e126e6edfcf60f7284 to your computer and use it in GitHub Desktop.
Save tarunon/b653d9326f1196e126e6edfcf60f7284 to your computer and use it in GitHub Desktop.
Swift3.1 crashes caused 2 file.
protocol A {}
class O {}
extension O: A {}
struct F<X: O> where X: A {
}
extension F {
func f() -> F {
return F()
}
}
@tarunon
Copy link
Author

tarunon commented Mar 30, 2017

実際にはFのwhere句は不要なので、削除すれば良いだけではある。

@tarunon
Copy link
Author

tarunon commented Mar 30, 2017

条件は
1. Generics型にクラスを与え、重複した条件で束縛する。
2. extensionに自身を返す関数を定義。
3. クラスの定義とファイルを分離する。

の3つかしら

@tarunon
Copy link
Author

tarunon commented Mar 31, 2017

4. ReturnSelfFunction.swiftを先にswiftcに渡す という変態じみた条件がありました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment