-
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.
Remove tvars introduced while testing normalizedCompatible
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 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,10 @@ | ||
// Justifies the need to add defn.PolyFunctionOf in simplify | ||
// Without, the TypeVar for the U in fn's lambda | ||
// replaces the TypeParamRef U, in simplify. | ||
class B[U] | ||
class Test(): | ||
def fn[T]: [U] => Int => B[U] = [U] => (x: Int) => new B[U]() | ||
def test(): Unit = | ||
fn(1) | ||
fn(2) | ||
() |
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,15 @@ | ||
// Justifies the need for TypeApply in tryInsertImplicitOnQualifier | ||
// after failing ys.map[?B, C] using Zipped2's map | ||
// we want to try ys.map[?B] using Coll's map, after toColl | ||
final class Coll[+A]: | ||
def map[B](f: A => B): Coll[B] = new Coll[B] | ||
def lazyZip[B](that: Coll[B]): Zipped2[A, B] = new Zipped2[A, B](this, that) | ||
final class Zipped2[+X, +Y](xs: Coll[X], ys: Coll[Y]): | ||
def map[B, C](f: (X, Y) => B): Coll[C] = new Coll[C] | ||
object Zipped2: | ||
import scala.language.implicitConversions | ||
implicit def toColl[X, Y](zipped2: Zipped2[X, Y]): Coll[(X, Y)] = new Coll[(X, Y)] | ||
class Test: | ||
def test(xs: Coll[Int]): Unit = | ||
val ys = xs.lazyZip(xs) | ||
ys.map((x: (Int, Int)) => x._1 + x._2) |