We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b1b747 commit fd81860Copy full SHA for fd81860
compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala
@@ -76,6 +76,8 @@ class TryCatchPatterns extends MiniPhase {
76
(pre == NoPrefix || pre.widen.typeSymbol.isStatic) && // Does not require outer class check
77
!tp.symbol.is(Flags.Trait) && // Traits not supported by JVM
78
tp.derivesFrom(defn.ThrowableClass)
79
+ case tp: AppliedType =>
80
+ isSimpleThrowable(tp.tycon)
81
case _ =>
82
false
83
}
tests/pos/i746.scala
@@ -0,0 +1,10 @@
1
+class Test[T] {
2
+
3
+ def f(x: Int) = try {
4
+ ???
5
+ }
6
+ catch {
7
+ case ex: scala.runtime.NonLocalReturnControl[T @scala.unchecked] =>
8
9
10
+}
0 commit comments