-
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.
Avoid forcing ctors & parents which caused cycles
- Loading branch information
Showing
21 changed files
with
202 additions
and
74 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
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,4 @@ | ||
trait Foo | ||
trait X[T <: Foo] { trait Id } | ||
object A extends X[B] // error: Type argument B does not conform to upper bound Foo | ||
class B extends A.Id |
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 Foo[A] | ||
class Foo1(val x: Int) | ||
extends Foo[ // error: The type of a class parent cannot refer to constructor parameters, but Foo[(Foo1.this.x : Int)] refers to x | ||
x.type | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
trait Foo | ||
trait X[T <: Foo] { trait Id } | ||
object A extends X[B] | ||
class B extends A.Id with Foo |
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,4 @@ | ||
trait Foo | ||
trait X[T <: Foo] { trait Id extends Foo } | ||
object A extends X[B] | ||
class B extends A.Id |
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,3 @@ | ||
trait X[T] { trait Id } | ||
object A extends X[B] | ||
class B extends A.Id |
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,10 @@ | ||
// 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]( // error: Something's wrong: missing original symbol for type tree | ||
id: | ||
A | ||
.Id) // should-be-error: type Id is not a member of object A | ||
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,2 @@ | ||
class Bar(val y: Long) | ||
class Bar1(val z: Long) extends Bar(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,5 @@ | ||
// 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) |
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 @@ | ||
// like tests/pos/i15177.scala | ||
// but with B being higher kinded | ||
class X[T[_]] { type Id } | ||
class A extends X[B] | ||
class B[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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//> using options -language:experimental.modularity -source future | ||
// A minimisation of pos/hylolib-cb that broke while fixing i15177 | ||
trait Value[Self] | ||
trait Coll[Self]: | ||
type Pos: Value | ||
extension (self: Self) def pos: Pos | ||
extension [Self: Coll](self: Self) def trigger = self.pos | ||
class Slice[Base] | ||
given SliceIsColl[T: Coll as c]: Coll[Slice[T]] with | ||
type Pos = c.Pos | ||
extension (self: Slice[T]) def pos: Pos = ??? |
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,3 @@ | ||
class X[T] { trait Id } | ||
object A extends X[B] | ||
class B(id: A.Id) |
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,3 @@ | ||
class X[T] { trait Id } | ||
class A extends X[B] | ||
class B |
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 @@ | ||
//> using options -language:experimental.modularity -source future | ||
|
||
trait Foo: | ||
type Self | ||
type Bar | ||
|
||
given inst[A: Foo, B: Foo { type Bar = A.Bar }]: Foo with | ||
type Self = String | ||
type Bar = A.Bar |