Skip to content

Commit 17fb338

Browse files
authored
Merge pull request #12486 from DougGregor/sr-6141
2 parents b67aaef + d6bd66e commit 17fb338

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/SILGen/unreachable_code.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,9 @@ class TestThrowInInit {
131131
throw e // no unreachable code diagnostic for the implicit return.
132132
}
133133
}
134+
135+
func sr6141() {
136+
var bar: String? = ""
137+
return;
138+
bar?.append("x") // expected-warning{{code after 'return' will never be executed}}
139+
}

0 commit comments

Comments
 (0)