Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save creaaa/166097d0db2093e143eb58843296ed87 to your computer and use it in GitHub Desktop.
Save creaaa/166097d0db2093e143eb58843296ed87 to your computer and use it in GitHub Desktop.
おかしいだろ
// let box = Box(42)
// box as! Box<Bool> // 実行時死ぬ
Box(42) as! Box<Bool> // コンパイルエラー
なぜ!!!!!!!!!!!!!!!!!!!!!??????????????????????????????
@creaaa
Copy link
Author

creaaa commented Apr 11, 2018

1行で書いたときだけ、コンパイラは感知する(むしろ"感知できる")、って感じなんだな。たぶん。
まぁそれならわかるか...。
てか、as! がコンパイルエラーになるパターンもあったんか。

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