Skip to content

Commit 1ac0b4a

Browse files
authored
Merge pull request #2893 from dotty-staging/fix-#2637
Fix #2637: Fix confusion between AppliedTypeTree and TypeApply
2 parents 56933ec + 60efdfc commit 1ac0b4a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Inferencing.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ object Inferencing {
123123
def inferTypeParams(tree: Tree, pt: Type)(implicit ctx: Context): Tree = tree.tpe match {
124124
case tl: TypeLambda =>
125125
val (tl1, tvars) = constrained(tl, tree)
126-
val tree1 = tree.withType(tl1).appliedToTypeTrees(tvars)
126+
var tree1 = AppliedTypeTree(tree.withType(tl1), tvars)
127127
tree1.tpe <:< pt
128128
fullyDefinedType(tree1.tpe, "template parent", tree.pos)
129129
tree1

tests/pos/i2637.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
object Hello {
2+
def main(args: Array[String]): Unit = {
3+
sealed trait Wat[T]
4+
5+
implicit def intWat: Wat[Int] = ???
6+
implicit def listWat[T](implicit tWat: Wat[T]): Wat[List[T]] = new Wat{}
7+
8+
def stuff[T](implicit implicitWat: => Wat[List[T]]): Unit = ???
9+
}
10+
}

0 commit comments

Comments
 (0)