Skip to content

Commit 29c3034

Browse files
authored
Merge pull request #2603 from dotty-staging/fix-2591
Fix #2591: Incorrect documentation on general type projections
2 parents e5cafa2 + 0272c7c commit 29c3034

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/docs/reference/dropped/type-projection.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ title: Dropped: General Type Projection
66
Scala so far allowed general type projection `T#A` where `T` is an arbitrary type
77
and `A` names a type member of `T`.
88

9-
Dotty allows this only if `T` is a class type. The change was made because
10-
unrestricted type projection is [unsound](https://github.com/lampepfl/dotty/issues/1050).
9+
Dotty disallows this if `T` is an abstract type (class types and type aliases
10+
are fine). This change was made because unrestricted type projection
11+
is [unsound](https://github.com/lampepfl/dotty/issues/1050).
1112

12-
The restriction rule out the [type-level encoding of compbinator
13-
calculus](https://michid.wordpress.com/2010/01/29/scala-type-level-encoding-of-the-ski-calculus/). It also rules out the previous encodings of type
14-
lambdas using structural types with projection as application. Type
15-
lambdas are now [directly supported](../type-lambdas.md) in Dotty.
13+
This restriction rules out the [type-level encoding of a combinator
14+
calculus](https://michid.wordpress.com/2010/01/29/scala-type-level-encoding-of-the-ski-calculus/).
15+
16+
To rewrite code using type projections on abstract types, consider using
17+
path-dependent types or implicit parameters.

0 commit comments

Comments
 (0)