Skip to content

Commit ad73bf2

Browse files
committed
Fix crash: ensure class type is applied
Otherwise, looking up type members will crash
1 parent 09f7533 commit ad73bf2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

compiler/src/dotty/tools/dotc/transform/init/Checking.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ object Checking {
203203
PromoteThis(pot, source, state.path).toErrors
204204

205205
case warm: Warm =>
206-
val classRef = warm.classSymbol.typeRef
206+
val classRef = warm.classSymbol.info.asInstanceOf[ClassInfo].appliedRef
207207

208208
// only check small classes
209209
val methods = classRef.decls.filter(sym => sym.is(Flags.Method))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import scala.compiletime.ops.int._
2+
3+
object Test {
4+
class Vec[S <: Int] {
5+
infix def concat [RS <: Int](that : Vec[RS]) : Vec[S + RS] = new Vec[S + RS]
6+
}
7+
8+
val v1 = new Vec[1]
9+
val v2 = new Vec[2]
10+
val v3 : Vec[3] = v1 concat v2
11+
val v3a = v1 concat v2
12+
val v3b : Vec[3] = v3a
13+
}

0 commit comments

Comments
 (0)