Avatar
Avatar
norio_nomura
@swift-main@swift-4.0.3 -Xfrontend -debug-constraints enum O<W> { case some(W) } if case O<Int>.some(..<0) = O<Int>.some(-1) { print("OK") } Optionalかどうかは関係なく、caseで型チェックに失敗したら、指定の型シグネチャが同じ場合にdeep equalityって仕組みが働いてるぽい?この場合はO<Int>.someを取り除いて型推論されてる様に見える。 (edited)
OK---Constraint solving for the expression at [<stdin>:2:29 - line:2:43]--- (overload set choice binding $T0 := ($T1) -> O<$T1>) ---Initial constraints for the given expression--- (edited)
35.27 KB