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:
445
445
else candidates -= name
446
446
case None =>
447
447
traverseChildren(tree)
448
- case _: (If | WhileDo | Typed | Match | CaseDef) =>
448
+ case _: (If | WhileDo | Typed | Match | CaseDef | untpd.ParsedTry ) =>
449
449
traverseChildren(tree) // assignments to candidate variables are OK here ...
450
450
case _ =>
451
451
reachable = Set.empty // ... but not here
Original file line number Diff line number Diff line change @@ -6,3 +6,16 @@ def m(): String = {
6
6
if(x == null) "foo"
7
7
else x
8
8
}
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