Work in Progress

We are still in the process of writing the documentation for Scala 3. You can help us to improve the documentation.

Are you searching for the Scala 2 documentation?

Scala 3 Language Reference

Dropped: General Type Projection

Language

Scala so far allowed general type projection T#A where T is an arbitrary type and A names a type member of T.

Scala 3 disallows this if T is an abstract type (class types and type aliases are fine). This change was made because unrestricted type projection is unsound.

This restriction rules out the type-level encoding of a combinator calculus.

To rewrite code using type projections on abstract types, consider using path-dependent types or implicit parameters.

Contributors to this page: