Skip to content

Commit ac0363b

Browse files
committed
[tests] Include tuple destructuring test case for placeholder types
Courtesy of @exfalsoquodlibet on the forums
1 parent f6b6bff commit ac0363b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/Sema/placeholder_type.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,17 @@ let _: SetFailureType<Int, String> = Just<Int>().setFailureType(to: _.self).setF
202202

203203
let _: (_) = 0 as Int // expected-error {{placeholders are not allowed as top-level types}}
204204
let _: Int = 0 as (_) // expected-error {{placeholders are not allowed as top-level types}}
205+
206+
_ = (1...10)
207+
.map {
208+
(
209+
$0,
210+
(
211+
"\($0)",
212+
$0 > 5
213+
)
214+
)
215+
}
216+
.map { (intValue, x: (_, boolValue: _)) in
217+
x.boolValue ? intValue : 0
218+
}

0 commit comments

Comments
 (0)