Skip to content

Commit 5f7e290

Browse files
committed
Merge pull request #804 from svalaskevicius/fix-compiling-ScalaRunTime
fix compiling ScalaRunTime.scala
2 parents 3ae9347 + 1c131d5 commit 5f7e290

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/dotty/tools/dotc/typer/Typer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
826826
}
827827

828828
def typedAppliedTypeTree(tree: untpd.AppliedTypeTree)(implicit ctx: Context): Tree = track("typedAppliedTypeTree") {
829-
val tpt1 = typed(tree.tpt)
829+
val tpt1 = typed(tree.tpt)(ctx retractMode Mode.Pattern)
830830
val tparams = tpt1.tpe.typeParams
831831
var args = tree.args
832832
if (tparams.isEmpty) {

tests/pos/Patterns.scala

+9
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ object Patterns {
9393
case t: a2.B =>
9494
t
9595
}
96+
97+
class caseWithPatternVariableHelper1[A]
98+
class caseWithPatternVariableHelper2[A]
99+
100+
def caseWithPatternVariable(x: Any) = x match {
101+
case a: caseWithPatternVariableHelper1[_] => ()
102+
case b: caseWithPatternVariableHelper2[_] => ()
103+
}
104+
96105
}
97106

98107
object NestedPattern {

0 commit comments

Comments
 (0)