Type Ascription vs. Type Annotation in section 3
vladap opened this issue · comments
I believe that what is called Type Ascription in section 3 is actually called Type Annotation in Scala. Type Ascription is a bit different. See Scala documentation which states:
Type ascription is often confused with type annotation, as the syntax in Scala is identical. The following are examples of ascription:
Nil: List[String]
Set(values: _*)
"Daniel": AnyRefAscription is basically just an up-cast performed at compile-time for the sake of the type checker. Its use is not common, but it does happen on occasion. The most often seen case of ascription is invoking a varargs method with a single Seq parameter. This is done by ascribing the _* type (as in the second example above).
Ascription follows the type annotation conventions; a space follows the colon.
Hence I think section 3 should be renamed to Type Annotation and new section could be created for Type Ascription.
Yes indeed. Would you submit a PR with this fix? Thanks a lot in advance!