-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SI-6846, regression in type constructor inference.
In 658ba1b some inference was gained and some was lost. In this commit we regain what was lost and gain even more. Dealiasing and widening should be fully handled now, as illustrated by the test case.
- Loading branch information
Showing
3 changed files
with
40 additions
and
13 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,28 @@ | ||
object Test { | ||
class Arb[_] | ||
implicit def foo[M[_], A]: Arb[M[A]] = null | ||
foo: Arb[List[Int]] | ||
type ListInt = List[Int] | ||
foo: Arb[ListInt] | ||
} | ||
|
||
object Test2 { | ||
import scala.collection.immutable.List | ||
|
||
class Carb[_] | ||
implicit def narrow[N, M[_], A](x: Carb[M[A]])(implicit ev: N <:< M[A]): Carb[N] = null | ||
implicit def bar[M[_], A]: Carb[M[A]] = null | ||
|
||
type ListInt = List[Int] | ||
|
||
val x: List[Int] = List(1) | ||
val y: ListInt = List(1) | ||
|
||
type ListSingletonX = x.type | ||
type ListSingletonY = y.type | ||
|
||
bar: Carb[List[Int]] | ||
bar: Carb[ListInt] | ||
bar: Carb[ListSingletonX] | ||
bar: Carb[ListSingletonY] | ||
} |