Closed
Description
- Initial implementation — SIP-23 Implementation of literal types scala#5310
- Spec update — included in PR
- Fix issues and respond to feedback from TLS experience — in progress
- SIP update
- Coordination with Dotty
From the initial PR,
- Literals can now appear in type position, designating the corresponding singleton type.
- Widening/narrowing behaviour is consistent with 2.11.x and between 2.12.x with the flag enabled and disabled. The use of final on a val definition to explicitly request an unwidened type to be inferred is preserved. Type parameter inference remains the same unless the inference of a singleton type is explicitly requested via a <: Singleton bound.
- A scala.ValueOf[T] type class and corresponding scala.Predef.valueOf[T] operator has been added yielding the unique value of types with a single inhabitant.
- isInstanceOf/asInstanceOf tests/conversions are implemented via equality/identity tests for singleton types.
- Support for scala.Symbol literal types has been added.