What is the purpose of type ascriptions in Scala?
Type ascription is just telling the compiler what type you expect out of an expression, from all possible valid types. A type is valid if it respects existing constraints, such as variance and type declarations, and it is either one of the types the expression it applies to “is a“, or there’s a conversion that … Read more