raulraja
05/14/2018, 8:04 PMas
is missleading since it's already associated with casting. I think what you have here is an explicit type ascription and :
would be more appropiate since that is already used for type ascription in functions, local variables etc.
It's also how it's represented in other languages:
https://stackoverflow.com/questions/36389974/what-is-type-ascription
https://stackoverflow.com/questions/2087250/what-is-the-purpose-of-type-ascriptions-in-scala
takesAmbiguousType([1, 2, 3] : Set<Int>) // OK
takesAmbiguousType([1, 2, 3] : Array<Int>) // OK
benleggiero
05/15/2018, 1:59 AMvar x = 7 as Short
I was under the impression that was type hinting, but I was probably thinking in Swift mode. I should’ve actually tried it and seen the “can never succeed” compiler warning.
Ascription sounds like an interesting thing. Also sounds like a separate proposal which might block this one?