Skip to content

Commit 5bb2870

Browse files
committed
Fix #7969: Don't let typevars be bounded by ExprTypes
1 parent 842e4c4 commit 5bb2870

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ trait ConstraintHandling[AbstractContext] {
508508
case inst =>
509509
prune(inst)
510510
}
511+
case bound: ExprType =>
512+
NoType
511513
case _ =>
512514
pruneLambdaParams(bound)
513515
}

tests/neg/i7969.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object O{
2+
def f(i: => Int): Int = 1
3+
def m[A](a: A => Int) = 2
4+
def n = m(f) // error: cannot eta expand
5+
}

0 commit comments

Comments
 (0)