Skip to content

Commit f3276d6

Browse files
committed
Pattern-bound type refs should have Case flag set
Fixes #6157.
1 parent 6067ab7 commit f3276d6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ class TreeUnpickler(reader: TastyReader,
513513
def complete(denot: SymDenotation)(implicit ctx: Context) =
514514
denot.info = typeReader.readType()
515515
}
516-
val sym = ctx.newSymbol(ctx.owner, name, EmptyFlags, completer, coord = coordAt(start))
516+
val sym = ctx.newSymbol(ctx.owner, name, Flags.Case, completer, coord = coordAt(start))
517517
registerSym(start, sym)
518518
sym
519519
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object Utils {
2+
class Box[T]
3+
inline def foo[T](t: T) <: Any = inline t match {
4+
case _: Box[a] => scala.compiletime.constValue[a]
5+
}
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Utils._
2+
3+
object Test {
4+
val a = foo(new Box["a"])
5+
}

0 commit comments

Comments
 (0)