Skip to content

Commit 8781dab

Browse files
committed
Tests: Regression: Swift 2.1 ➜ 2.2: Type inference fails for Color.Wrap when operator-concatenating parameter array without annotation.
Annotating the entire array as `[(Color.Wrap, String)]` provides explicit type information for the operator-concatenation of the parameter array.
1 parent 48569b9 commit 8781dab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/PrettyColorsTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,13 @@ class PrettyColorsTests: XCTestCase {
380380
let formatted·number = NSString(format: "%02d", number) as String
381381

382382
for (appended·wrap, suffix) in [
383-
(wrap, "normal") as (Color.Wrap, String),
383+
(wrap, "normal"),
384+
// TODO: Investigate why `as (Color.Wrap, String)` before above comma
385+
// doesn't provide enough type info for the remaining lines in the array.
384386
(wrap + [ StyleParameter.Bold ], "bold"),
385387
(wrap + [ StyleParameter.Italic ], "italic"),
386388
(wrap + [ StyleParameter.Underlined ], "underlined")
387-
] {
389+
] /* type-inference fails without */ as [(Color.Wrap, String)] {
388390
let styled·output = (appended·wrap + style·wrap).wrap("__|øat·•ªº^∆©|__")
389391
print( "\(styled·output) \(formatted·number) + \(suffix)" )
390392
}

0 commit comments

Comments
 (0)