Skip to content

Pattern-bound type refs should have Case flag set #6172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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"])
}