File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class TryCatchPatterns extends MiniPhase {
7171 case _ => isDefaultCase(cdef)
7272 }
7373
74- private def isSimpleThrowable (tp : Type )(using Context ): Boolean = tp.stripped match {
74+ private def isSimpleThrowable (tp : Type )(using Context ): Boolean = tp.strippedDealias match {
7575 case tp @ TypeRef (pre, _) =>
7676 (pre == NoPrefix || pre.typeSymbol.isStatic) && // Does not require outer class check
7777 ! tp.symbol.is(Flags .Trait ) && // Traits not supported by JVM
Original file line number Diff line number Diff line change 1+ class E1 extends Exception
2+ class E2 extends Exception
3+
4+ type E1or2 = E1 | E2
5+
6+ @ main def Test =
7+ try throw new Exception {}
8+ catch
9+ case e : E1or2 => assert(e.isInstanceOf [E1or2 ])
10+ case _ => ()
You can’t perform that action at this time.
0 commit comments