-
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.
Perform bounds checking before checking self types. Checking self types interpolates them, which may give an upper approximation solution that failes subsequent bounds checks. On the other hand, well-formedness checkimng should come after self types checking since otherwise we get spurious "has empty capture set, cannot be tracked" messages.
- Loading branch information
Showing
3 changed files
with
38 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
trait Dsl: | ||
|
||
sealed trait Nat | ||
case object Zero extends Nat | ||
case class Succ[N <: Nat](n: N) extends Nat | ||
|
||
type Stable[+l <: Nat, +b <: Nat, +A] | ||
type Now[+l <: Nat, +b <: Nat, +A] | ||
type Box[+A] | ||
def stable[l <: Nat, b <: Nat, A](e: Stable[l, b, A]): Now[l, b, Box[A]] | ||
|
||
def program[A](prog: Now[Zero.type, Zero.type, A]): Now[Zero.type, Zero.type, A] | ||
|
||
//val conforms: Zero.type <:< Nat = summon | ||
// ^ need to uncomment this line to compile with captureChecking enabled | ||
|
||
def test: Any = | ||
program[Box[Int]]: | ||
val v : Stable[Zero.type, Zero.type, Int] = ??? | ||
stable[Zero.type, Zero.type, Int](v) | ||
// ^ | ||
// Type argument Dsl.this.Zero.type does not conform to upper bound Dsl.this.Nat |