-
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.
Cleanup retains annotations in all inferred type trees
- Loading branch information
Showing
3 changed files
with
43 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,20 @@ | ||
import language.experimental.captureChecking | ||
|
||
trait Iterable[T] { self: Iterable[T]^ => | ||
def map[U](f: T => U): Iterable[U]^{this, f} | ||
} | ||
|
||
object Test { | ||
def assertEquals[A, B](a: A, b: B): Boolean = ??? | ||
|
||
def foo[T](level: Int, lines: Iterable[T]) = | ||
lines.map(x => x) | ||
|
||
def bar(messages: Iterable[String]) = | ||
foo(1, messages) | ||
|
||
val it: Iterable[String] = ??? | ||
val msgs = bar(it) | ||
|
||
assertEquals(msgs, msgs) | ||
} |
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,16 @@ | ||
import language.experimental.captureChecking | ||
|
||
trait Iterable[T] { self: Iterable[T]^ => | ||
def map[U](f: T => U): Iterable[U]^{this, f} | ||
} | ||
|
||
object Test { | ||
def foo[T](level: Int, lines: Iterable[T]) = | ||
lines.map(x => x) | ||
|
||
class Bar: | ||
def bar(messages: Iterable[String]) = | ||
foo(1, messages) | ||
class Baz extends Bar: | ||
override def bar(messages: Iterable[String]) = ??? | ||
} |