forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A PoC for infering tracked with one working case
- Loading branch information
1 parent
687deb1
commit 7348c02
Showing
2 changed files
with
83 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import scala.language.experimental.modularity | ||
import scala.language.future | ||
|
||
abstract class C: | ||
type T | ||
def foo: T | ||
|
||
class F(val x: C): | ||
val result: x.T = x.foo | ||
|
||
class G(override val x: C) extends F(x) | ||
|
||
def Test = | ||
val c = new C: | ||
type T = Int | ||
def foo = 42 | ||
|
||
val f = new F(c) | ||
val i: Int = f.result | ||
|
||
// val g = new G(c) | ||
// val j: Int = g.result |