-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow simple type args of parent types to back reference
Can't do so for higher-kinded type arguments, as eta-expanding them requires completing them. Nor for applied type arguments, as typing the applied tree type requires completing the type constructor.
- Loading branch information
Showing
11 changed files
with
99 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// like tests/pos/i15177.scala | ||
// but with an applied type B[D] | ||
class X[T] { | ||
type Id | ||
} | ||
object A extends X[B[D]] | ||
class B[C](id: A | ||
.Id) // error | ||
class D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// like tests/pos/i15177.scala | ||
// but with B being higher kinded | ||
class X[T[_]] { | ||
type Id | ||
} | ||
object A extends X[B] | ||
class B[C](id: A | ||
.Id) // error: type Id is not a member of object A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// like tests/pos/i15177.scala | ||
// but with T having an upper bound | ||
// that B doesn't conform to | ||
// just to be sure that not forcing B | ||
// doesn't backdoor an illegal X[B] | ||
class X[T <: C] { | ||
type Id | ||
} | ||
object A | ||
extends X[ // error | ||
B] // error | ||
class B(id: A.Id) | ||
class C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
trait X[R <: Z, Z >: X[R, R] <: X[R, R]] // error // error | ||
trait X[R <: Z, Z >: X[R, R] <: X[R, R]] // error | ||
class Z extends X[Z, Z] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
trait FakeEnum[A, @specialized(Byte, Short, Int, Long) B] | ||
{ | ||
trait Value { | ||
self: A => | ||
def name: String | ||
def id: B | ||
} | ||
} | ||
|
||
object FakeEnumType | ||
extends FakeEnum[FakeEnumType, Short] | ||
{ | ||
val MEMBER1 = new FakeEnumType((0: Short), "MEMBER1") {} | ||
val MEMBER2 = new FakeEnumType((1: Short), "MEMBER2") {} | ||
} | ||
|
||
sealed abstract | ||
class FakeEnumType(val id: Short, val name: String) | ||
extends FakeEnumType.Value | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class X[T] { | ||
type Id | ||
} | ||
object A extends X[B] | ||
class B(id: A.Id) |