A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.scala-lang.org/scala3/reference/dropped-features/type-projection.html below:

Dropped: General Type Projection

Edit this page on GitHub Dropped: General Type Projection

Scala 2 allowed general type projection T#A where T is an arbitrary type and A names a type member of T. This turns out to be unsound (at least when combined with other Scala 3 features).

To remedy this, Scala 3 only allows type projection if T is a concrete type (any type which is not abstract), an example for such a type would be a class type (class T). A type is abstract if it is:

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

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4