Anything
: Null
= Kotlin : Any?
: Nothing?
の話を整理して Qiita に書きたい。 (edited)typealias Anything = Any? typealias Null = Nothing?
とすれば Ceylon と同じになる。typealias Object = Any
これもいるか。Never
が bottom type になるかもという話も興味深い。IMO, if we accept a single error type per function, there could be a simpler model for this. We could say that the `throws` type is a generic parameter of all function types, and it defaults to the uninhabited `Never` type for functions that don't throw. () -> () == () throws Never -> () () throws -> () == () throws Error -> () In this model, you'd get many benefits: - `rethrows` could become first-class, reducing down to just polymorphic `throws`: func foo(_: () throws -> ()) rethrows // Swift 3 func foo<T: Error>(_: () throws T -> ()) throws T // Swift X
Never
が bottom type でないと辻褄が合わない。