We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4e92703 + c8f66e4 commit 2828fcfCopy full SHA for 2828fcf
compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala
@@ -168,7 +168,8 @@ object TypeTestsCasts {
168
cpy.TypeApply(tree)(expr1.select(sym).withSpan(expr.span), List(TypeTree(tp)))
169
170
def effectiveClass(tp: Type): Symbol =
171
- if (tp.isRef(defn.PairClass)) effectiveClass(erasure(tp))
+ if tp.isRef(defn.PairClass) then effectiveClass(erasure(tp))
172
+ else if tp.isRef(defn.AnyValClass) then defn.AnyClass
173
else tp.classSymbol
174
175
def foundCls = effectiveClass(expr.tpe.widen)
tests/run/i7783.scala
@@ -0,0 +1,6 @@
1
+object Test extends App {
2
+ def foo(t: AnyVal): Unit = t match {
3
+ case _: Int =>
4
+ }
5
+ foo(3)
6
+}
0 commit comments