Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Flags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ object Flags {
final val PackageVal: FlagSet = Package.toTermFlags
final val PackageClass: FlagSet = Package.toTypeFlags

/** A case class or its companion object */
/** A case class or its companion object
* Note: Case is also used to indicate that a symbol is bound by a pattern.
*/
final val Case: FlagSet = commonFlag(17, "case")
final val CaseClass: FlagSet = Case.toTypeFlags
final val CaseVal: FlagSet = Case.toTermFlags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ class TreeUnpickler(reader: TastyReader,
def complete(denot: SymDenotation)(implicit ctx: Context) =
denot.info = typeReader.readType()
}
val sym = ctx.newSymbol(ctx.owner, name, EmptyFlags, completer, coord = coordAt(start))
val sym = ctx.newSymbol(ctx.owner, name, Flags.Case, completer, coord = coordAt(start))
registerSym(start, sym)
sym
}
Expand Down
6 changes: 6 additions & 0 deletions tests/pos/inline-match-separate/inline-match-separate_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
object Utils {
class Box[T]
inline def foo[T](t: T) <: Any = inline t match {
case _: Box[a] => scala.compiletime.constValue[a]
}
}
5 changes: 5 additions & 0 deletions tests/pos/inline-match-separate/inline-match-separate_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Utils._

object Test {
val a = foo(new Box["a"])
}