File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -445,7 +445,7 @@ object Nullables:
445445 else candidates -= name
446446 case None =>
447447 traverseChildren(tree)
448- case _ : (If | WhileDo | Typed | Match | CaseDef ) =>
448+ case _ : (If | WhileDo | Typed | Match | CaseDef | untpd. ParsedTry ) =>
449449 traverseChildren(tree) // assignments to candidate variables are OK here ...
450450 case _ =>
451451 reachable = Set .empty // ... but not here
Original file line number Diff line number Diff line change @@ -6,3 +6,16 @@ def m(): String = {
66 if (x == null ) " foo"
77 else x
88}
9+
10+ def m2 (): String = {
11+ var x : String | Null = " foo"
12+ try {
13+ x = x
14+ } catch {
15+ case e => x = x
16+ } finally {
17+ x = x
18+ }
19+ if (x == null ) " foo"
20+ else x
21+ }
You can’t perform that action at this time.
0 commit comments