Skip to content

Commit f2c9393

Browse files
committed
[SILGen]: Add test for parenthesized try expression
1 parent 49dd95f commit f2c9393

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/SILGen/typed_throws.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,11 @@ class MySubclass: MyClass {
315315
class MySubsubclass: MySubclass {
316316
override func f() { }
317317
}
318+
319+
// Check that SILGen does not crash because of a parenthesized try expression
320+
class Class {
321+
var num: Int = 1
322+
323+
init() throws {}
324+
}
325+
_ = (try Class().num)

0 commit comments

Comments
 (0)