Skip to content

Commit c1ed499

Browse files
committed
[tests] Update type placeholder diagnostics
1 parent ac0363b commit c1ed499

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

test/Sema/placeholder_type.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let dict2: [Character: _] = ["h": 0]
77

88
let arr = [_](repeating: "hi", count: 3)
99

10-
func foo(_ arr: [_] = [0]) {} // expected-error {{placeholder type not allowed here}}
10+
func foo(_ arr: [_] = [0]) {} // expected-error {{type placeholder not allowed here}}
1111

1212
let foo = _.foo // expected-error {{placeholders are not allowed as top-level types}}
1313
let zero: _ = .zero // expected-error {{placeholders are not allowed as top-level types}}
@@ -75,25 +75,25 @@ where T: ExpressibleByIntegerLiteral, U: ExpressibleByIntegerLiteral {
7575
}
7676

7777
extension Bar {
78-
func frobnicate2() -> Bar<_, _> { // expected-error {{placeholder type not allowed here}}
78+
func frobnicate2() -> Bar<_, _> { // expected-error {{type placeholder not allowed here}}
7979
return Bar(t: 42, u: 42)
8080
}
8181
func frobnicate3() -> Bar {
8282
return Bar<_, _>(t: 42, u: 42)
8383
}
84-
func frobnicate4() -> Bar<_, _> { // expected-error {{placeholder type not allowed here}}
84+
func frobnicate4() -> Bar<_, _> { // expected-error {{type placeholder not allowed here}}
8585
return Bar<_, _>(t: 42, u: 42)
8686
}
87-
func frobnicate5() -> Bar<_, U> { // expected-error {{placeholder type not allowed here}}
87+
func frobnicate5() -> Bar<_, U> { // expected-error {{type placeholder not allowed here}}
8888
return Bar(t: 42, u: 42)
8989
}
9090
func frobnicate6() -> Bar {
9191
return Bar<_, U>(t: 42, u: 42)
9292
}
93-
func frobnicate7() -> Bar<_, _> { // expected-error {{placeholder type not allowed here}}
93+
func frobnicate7() -> Bar<_, _> { // expected-error {{type placeholder not allowed here}}
9494
return Bar<_, U>(t: 42, u: 42)
9595
}
96-
func frobnicate8() -> Bar<_, U> { // expected-error {{placeholder type not allowed here}}
96+
func frobnicate8() -> Bar<_, U> { // expected-error {{type placeholder not allowed here}}
9797
return Bar<_, _>(t: 42, u: 42)
9898
}
9999
}
@@ -147,12 +147,12 @@ func f(x: Any, arr: [Int]) {
147147
let y3 = x as! () -> _ // expected-error {{type of expression is ambiguous without more context}}
148148

149149
switch x {
150-
case is _: break // expected-error {{placeholder type not allowed here}}
151-
case is [_]: break // expected-error {{placeholder type not allowed here}}
152-
case is () -> _: break // expected-error {{placeholder type not allowed here}}
153-
case let y as _: break // expected-error {{placeholder type not allowed here}}
154-
case let y as [_]: break // expected-error {{placeholder type not allowed here}}
155-
case let y as () -> _: break // expected-error {{placeholder type not allowed here}}
150+
case is _: break // expected-error {{type placeholder not allowed here}}
151+
case is [_]: break // expected-error {{type placeholder not allowed here}}
152+
case is () -> _: break // expected-error {{type placeholder not allowed here}}
153+
case let y as _: break // expected-error {{type placeholder not allowed here}}
154+
case let y as [_]: break // expected-error {{type placeholder not allowed here}}
155+
case let y as () -> _: break // expected-error {{type placeholder not allowed here}}
156156
}
157157

158158
if arr is _ {} // expected-error {{placeholders are not allowed as top-level types}}
@@ -166,12 +166,12 @@ func f(x: Any, arr: [Int]) {
166166
let y3 = arr as! () -> _ // expected-error {{type of expression is ambiguous without more context}}
167167

168168
switch arr {
169-
case is _: break // expected-error {{placeholder type not allowed here}}
170-
case is [_]: break // expected-error {{placeholder type not allowed here}}
171-
case is () -> _: break // expected-error {{placeholder type not allowed here}}
172-
case let y as _: break // expected-error {{placeholder type not allowed here}}
173-
case let y as [_]: break // expected-error {{placeholder type not allowed here}}
174-
case let y as () -> _: break // expected-error {{placeholder type not allowed here}}
169+
case is _: break // expected-error {{type placeholder not allowed here}}
170+
case is [_]: break // expected-error {{type placeholder not allowed here}}
171+
case is () -> _: break // expected-error {{type placeholder not allowed here}}
172+
case let y as _: break // expected-error {{type placeholder not allowed here}}
173+
case let y as [_]: break // expected-error {{type placeholder not allowed here}}
174+
case let y as () -> _: break // expected-error {{type placeholder not allowed here}}
175175
}
176176
}
177177

test/type/opaque.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,5 +519,5 @@ func takesOpaqueProtocol<T : OpaqueProtocol>(generic: T) {
519519
_ = generic[0]
520520
}
521521

522-
func opaquePlaceholderFunc() -> some _ { 1 } // expected-error {{placeholder type not allowed here}}
523-
var opaquePlaceholderVar: some _ = 1 // expected-error {{placeholder type not allowed here}}
522+
func opaquePlaceholderFunc() -> some _ { 1 } // expected-error {{type placeholder not allowed here}}
523+
var opaquePlaceholderVar: some _ = 1 // expected-error {{type placeholder not allowed here}}

0 commit comments

Comments
 (0)