Skip to content

Commit 088307f

Browse files
committed
[test] Update ASTGen tests for single expression returns
These now work because we're doing the transform in Sema. Closure parameter generation still needs some extra work unfortunately, so we can't add tests for that.
1 parent f4a6b95 commit 088307f

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/ASTGen/decls.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ func test7() {
6767

6868
func test8(_: Int) {}
6969

70+
func test9() -> Int { 0 }
71+
7072
func testVars() {
7173
var a = 0
7274
var b: Int = 0
7375
var c, d: Int
7476
var e, f: Int, g, h, i: String
7577
let j: Int = 0, k: String = ""
7678

77-
// FIXME: We don't yet handle single expression bodies.
78-
var l: Int { return 0 }
79-
var m: Int { get { return 0 } }
79+
var l: Int { 0 }
80+
var m: Int { get { 0 } }
8081
var n: Int {
8182
get { return m }
8283
set {}
@@ -113,9 +114,8 @@ struct TestVars {
113114
var e, f: Int, g, h, i: String
114115
let j: Int = 0, k: String = ""
115116

116-
// FIXME: We don't yet handle single expression bodies.
117-
var l: Int { return 0 }
118-
var m: Int { get { return 0 } }
117+
var l: Int { 0 }
118+
var m: Int { get { 0 } }
119119
var n: Int {
120120
get { return m }
121121
set {}
@@ -151,8 +151,7 @@ extension TestVars {
151151

152152
struct TestSubscripts {
153153
subscript(x: Int) -> Int {
154-
// FIXME: We don't yet handle single expression bodies.
155-
return 0
154+
0
156155
}
157156
subscript(y x: Int) -> Int {
158157
get {

0 commit comments

Comments
 (0)