From af54229ad7154e39cd0e221f752c1a4fdad22362 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 30 May 2017 14:07:18 +0200 Subject: [PATCH 1/2] Fix #2591: Incorrect documentation on general type projections --- docs/docs/reference/dropped/type-projection.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/docs/reference/dropped/type-projection.md b/docs/docs/reference/dropped/type-projection.md index 1e2e986d5e9c..51ba7accf703 100644 --- a/docs/docs/reference/dropped/type-projection.md +++ b/docs/docs/reference/dropped/type-projection.md @@ -6,10 +6,9 @@ title: Dropped: General Type Projection Scala so far allowed general type projection `T#A` where `T` is an arbitrary type and `A` names a type member of `T`. -Dotty allows this only if `T` is a class type. The change was made because -unrestricted type projection is [unsound](https://github.com/lampepfl/dotty/issues/1050). +Dotty 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](https://github.com/lampepfl/dotty/issues/1050). -The restriction rule out the [type-level encoding of compbinator - 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 -lambdas using structural types with projection as application. Type - lambdas are now [directly supported](../type-lambdas.md) in Dotty. \ No newline at end of file +To rewrite code using type projections on abstract types, consider using +path-dependent types or implicit parameters. From 0272c7c80f6638772a2157108e7067a14bffeefc Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 30 May 2017 14:34:25 +0200 Subject: [PATCH 2/2] Add back info on typelevel combinator calculus --- docs/docs/reference/dropped/type-projection.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docs/reference/dropped/type-projection.md b/docs/docs/reference/dropped/type-projection.md index 51ba7accf703..ccc4259e2230 100644 --- a/docs/docs/reference/dropped/type-projection.md +++ b/docs/docs/reference/dropped/type-projection.md @@ -10,5 +10,8 @@ Dotty 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](https://github.com/lampepfl/dotty/issues/1050). +This restriction rules out the [type-level encoding of a combinator +calculus](https://michid.wordpress.com/2010/01/29/scala-type-level-encoding-of-the-ski-calculus/). + To rewrite code using type projections on abstract types, consider using path-dependent types or implicit parameters.