Skip to content

Commit b199bf4

Browse files
authored
Merge pull request #3716 from dotty-staging/fix-#3637
Fix #3637: Handle SkolemTypes in avoid
2 parents 6a46b07 + fbc48c2 commit b199bf4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ trait TypeAssigner {
110110
}
111111
case tp: ThisType if toAvoid(tp.cls) =>
112112
range(tp.bottomType, apply(classBound(tp.cls.classInfo)))
113+
case tp: SkolemType if partsToAvoid(mutable.Set.empty, tp.info).nonEmpty =>
114+
range(tp.info.bottomType, apply(tp.info))
113115
case tp: TypeVar if ctx.typerState.constraint.contains(tp) =>
114116
val lo = ctx.typeComparer.instanceType(tp.origin, fromBelow = variance >= 0)
115117
val lo1 = apply(lo)

tests/pos/i3637.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import reflect.ClassTag
2+
3+
object Demo {
4+
def the[T](implicit ev: T): ev.type = ev // More precise implicitly, needed to crash
5+
6+
{
7+
case class B(i: Int)
8+
the[ClassTag[B]] // Has to be the last statement of the block
9+
}
10+
}

0 commit comments

Comments
 (0)