Skip to content

Commit e3118f1

Browse files
committed
Miscellaneous test migrations
1 parent cacc5ca commit e3118f1

File tree

7 files changed

+37
-37
lines changed

7 files changed

+37
-37
lines changed

test/Misc/misc_diagnostics.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -swift-version 3
1+
// RUN: %target-typecheck-verify-swift
22

33
// REQUIRES: objc_interop
44

@@ -135,9 +135,9 @@ func test20770032() {
135135

136136

137137

138-
func tuple_splat1(_ a : Int, _ b : Int) { // expected-note {{'tuple_splat1' declared here}}
138+
func tuple_splat1(_ a : Int, _ b : Int) { // expected-note 2 {{'tuple_splat1' declared here}}
139139
let x = (1,2)
140-
tuple_splat1(x) // expected-error {{passing 2 arguments to a callee as a single tuple value has been removed in Swift 3}}
140+
tuple_splat1(x) // expected-error {{missing argument for parameter #2 in call}}
141141
tuple_splat1(1, 2) // Ok.
142142
tuple_splat1((1, 2)) // expected-error {{missing argument for parameter #2 in call}}
143143
}

test/Prototypes/UnicodeDecoders.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
// RUN: %target-build-swift %s -swift-version 3 -g -Onone -o %t
12+
// RUN: %target-build-swift %s -g -Onone -o %t
1313
// RUN: %target-run %t
1414
// REQUIRES: executable_test
1515

test/SILOptimizer/devirt_inherited_conformance.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -O %s -emit-sil -swift-version 3 | %FileCheck %s
1+
// RUN: %target-swift-frontend -O %s -emit-sil | %FileCheck %s
22

33
// Make sure that we can dig all the way through the class hierarchy and
44
// protocol conformances.
@@ -107,14 +107,14 @@ public protocol Comparable {
107107
}
108108

109109
// Define a custom operator to be used instead of ==
110-
infix operator --- { associativity left precedence 140 }
110+
infix operator ---
111111

112112
// Simple is a protocol that simply defines an operator and
113113
// a few methods with different number of arguments.
114114
public protocol Simple {
115115
func foo(_: Self) -> Bool
116116
func boo(_: Self, _: Self) -> Bool
117-
func ---(_: Self, _: Self) -> Bool
117+
static func ---(_: Self, _: Self) -> Bool
118118
}
119119

120120
public class C: Equatable, Comparable, Simple {

test/SourceKit/Refactoring/syntactic-rename.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ _ = Memberwise2.init(m: 2, n: Memberwise1(x: 34))
126126
// RUN: diff -u %S/syntactic-rename/rename-memberwise.expected %t.result/rename-memberwise.expected
127127
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/rename-layer.in.json %s >> %t.result/rename-layer.expected
128128
// RUN: diff -u %S/syntactic-rename/rename-layer.expected %t.result/rename-layer.expected
129-
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/rename-P.in.json %s -- -swift-version 3 >> %t.result/rename-P.expected
129+
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/rename-P.in.json %s >> %t.result/rename-P.expected
130130
// RUN: diff -u %S/syntactic-rename/rename-P.expected %t.result/rename-P.expected
131-
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/keywordbase.in.json %s -- -swift-version 3 >> %t.result/keywordbase.expected
131+
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/keywordbase.in.json %s >> %t.result/keywordbase.expected
132132
// RUN: diff -u %S/syntactic-rename/keywordbase.expected %t.result/keywordbase.expected
133133

134134
// RUN: %empty-directory(%t.ranges)

test/api-digester/compare-dump.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %empty-directory(%t.module-cache)
44
// RUN: %swift -emit-module -o %t.mod/cake1.swiftmodule %S/Inputs/cake1.swift -parse-as-library -I %S/Inputs/APINotesLeft %clang-importer-sdk-nosource
55
// RUN: %swift -emit-module -o %t.mod/cake2.swiftmodule %S/Inputs/cake2.swift -parse-as-library -I %S/Inputs/APINotesRight %clang-importer-sdk-nosource
6-
// RUN: %api-digester -dump-sdk -module cake1 -o %t.dump1.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -swift-version 3 -I %t.mod -I %S/Inputs/APINotesLeft
7-
// RUN: %api-digester -dump-sdk -module cake2 -o %t.dump2.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -swift-version 3 -I %t.mod -I %S/Inputs/APINotesRight
6+
// RUN: %api-digester -dump-sdk -module cake1 -o %t.dump1.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod -I %S/Inputs/APINotesLeft
7+
// RUN: %api-digester -dump-sdk -module cake2 -o %t.dump2.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod -I %S/Inputs/APINotesRight
88
// RUN: %api-digester -diagnose-sdk -print-module --input-paths %t.dump1.json -input-paths %t.dump2.json > %t.result
99
// RUN: diff -u %S/Outputs/Cake.txt %t.result

test/api-digester/dump-module.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %empty-directory(%t.sdk)
33
// RUN: %empty-directory(%t.module-cache)
44
// RUN: %swift -emit-module -o %t.mod/cake.swiftmodule %S/Inputs/cake.swift -parse-as-library
5-
// RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -sdk %t.sdk -swift-version 3 -I %t.mod
5+
// RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -sdk %t.sdk -I %t.mod
66
// RUN: diff -u %S/Outputs/cake.json %t.dump.json
77
// RUN: %api-digester -diagnose-sdk --input-paths %t.dump.json -input-paths %S/Outputs/cake.json
88

test/attr/attr_noescape.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// RUN: %target-typecheck-verify-swift -swift-version 3
1+
// RUN: %target-typecheck-verify-swift
22

33
@noescape var fn : () -> Int = { 4 } // expected-error {{attribute can only be applied to types, not declarations}}
44

55
func conflictingAttrs(_ fn: @noescape @escaping () -> Int) {} // expected-error {{@escaping conflicts with @noescape}}
6-
// expected-warning@-1{{@noescape is the default and is deprecated}} {{29-39=}}
6+
// expected-error@-1{{@noescape is the default and has been removed}} {{29-39=}}
77

88
func doesEscape(_ fn : @escaping () -> Int) {}
99

10-
func takesGenericClosure<T>(_ a : Int, _ fn : @noescape () -> T) {} // expected-warning{{@noescape is the default and is deprecated}} {{47-57=}}
10+
func takesGenericClosure<T>(_ a : Int, _ fn : @noescape () -> T) {} // expected-error{{@noescape is the default and has been removed}} {{47-57=}}
1111

1212

1313
var globalAny: Any = 0
@@ -189,8 +189,8 @@ class SomeClass {
189189

190190
// Implicit conversions (in this case to @convention(block)) are ok.
191191
@_silgen_name("whatever")
192-
func takeNoEscapeAsObjCBlock(_: @noescape @convention(block) () -> Void) // expected-warning{{@noescape is the default and is deprecated}} {{33-43=}}
193-
func takeNoEscapeTest2(_ fn : @noescape () -> ()) { // expected-warning{{@noescape is the default and is deprecated}} {{31-41=}}
192+
func takeNoEscapeAsObjCBlock(_: @noescape @convention(block) () -> Void) // expected-error{{@noescape is the default and has been removed}} {{33-43=}}
193+
func takeNoEscapeTest2(_ fn : @noescape () -> ()) { // expected-error{{@noescape is the default and has been removed}} {{31-41=}}
194194
takeNoEscapeAsObjCBlock(fn)
195195
}
196196

@@ -204,7 +204,7 @@ func testAutoclosure(_ a : @autoclosure () -> Int) { // expected-note{{parameter
204204
// <rdar://problem/19470858> QoI: @autoclosure implies @noescape, so you shouldn't be allowed to specify both
205205
func redundant(_ fn : @noescape // expected-error @+1 {{@noescape is implied by @autoclosure and should not be redundantly specified}}
206206
@autoclosure () -> Int) {
207-
// expected-warning@-2{{@noescape is the default and is deprecated}} {{23-33=}}
207+
// expected-error@-2{{@noescape is the default and has been removed}} {{23-33=}}
208208
}
209209

210210

@@ -221,7 +221,7 @@ func overloadedEach<P: P2, T>(_ source: P, _ transform: @escaping (P.Element) ->
221221

222222
struct S : P2 {
223223
typealias Element = Int
224-
func each(_ transform: @noescape (Int) -> ()) { // expected-warning{{@noescape is the default and is deprecated}} {{26-36=}}
224+
func each(_ transform: @noescape (Int) -> ()) { // expected-error{{@noescape is the default and has been removed}} {{26-36=}}
225225
overloadedEach(self, // expected-error {{cannot invoke 'overloadedEach' with an argument list of type '(S, (Int) -> (), Int)'}}
226226
transform, 1)
227227
// expected-note @-2 {{overloads for 'overloadedEach' exist with these partially matching parameter lists: (O, @escaping (O.Element) -> (), T), (P, @escaping (P.Element) -> (), T)}}
@@ -231,16 +231,16 @@ struct S : P2 {
231231

232232

233233
// rdar://19763676 - False positive in @noescape analysis triggered by parameter label
234-
func r19763676Callee(_ f: @noescape (_ param: Int) -> Int) {} // expected-warning{{@noescape is the default and is deprecated}} {{27-37=}}
234+
func r19763676Callee(_ f: @noescape (_ param: Int) -> Int) {} // expected-error{{@noescape is the default and has been removed}} {{27-37=}}
235235

236-
func r19763676Caller(_ g: @noescape (Int) -> Int) { // expected-warning{{@noescape is the default and is deprecated}} {{27-37=}}
236+
func r19763676Caller(_ g: @noescape (Int) -> Int) { // expected-error{{@noescape is the default and has been removed}} {{27-37=}}
237237
r19763676Callee({ _ in g(1) })
238238
}
239239

240240

241241
// <rdar://problem/19763732> False positive in @noescape analysis triggered by default arguments
242-
func calleeWithDefaultParameters(_ f: @noescape () -> (), x : Int = 1) {} // expected-warning{{@noescape is the default and is deprecated}} {{39-49=}}
243-
func callerOfDefaultParams(_ g: @noescape () -> ()) { // expected-warning{{@noescape is the default and is deprecated}} {{33-43=}}
242+
func calleeWithDefaultParameters(_ f: @noescape () -> (), x : Int = 1) {} // expected-error{{@noescape is the default and has been removed}} {{39-49=}}
243+
func callerOfDefaultParams(_ g: @noescape () -> ()) { // expected-error{{@noescape is the default and has been removed}} {{33-43=}}
244244
calleeWithDefaultParameters(g)
245245
}
246246

@@ -268,20 +268,20 @@ public func XCTAssert(_ expression: @autoclosure () -> Bool, _ message: String =
268268

269269

270270
/// SR-770 - Currying and `noescape`/`rethrows` don't work together anymore
271-
func curriedFlatMap<A, B>(_ x: [A]) -> (@noescape (A) -> [B]) -> [B] { // expected-warning{{@noescape is the default and is deprecated}} {{41-50=}}
271+
func curriedFlatMap<A, B>(_ x: [A]) -> (@noescape (A) -> [B]) -> [B] { // expected-error{{@noescape is the default and has been removed}} {{41-50=}}
272272
return { f in
273273
x.flatMap(f)
274274
}
275275
}
276276

277-
func curriedFlatMap2<A, B>(_ x: [A]) -> (@noescape (A) -> [B]) -> [B] { // expected-warning{{@noescape is the default and is deprecated}} {{42-51=}}
278-
return { (f : @noescape (A) -> [B]) in // expected-warning{{@noescape is the default and is deprecated}} {{17-27=}}
277+
func curriedFlatMap2<A, B>(_ x: [A]) -> (@noescape (A) -> [B]) -> [B] { // expected-error{{@noescape is the default and has been removed}} {{42-51=}}
278+
return { (f : @noescape (A) -> [B]) in // expected-error{{@noescape is the default and has been removed}} {{17-27=}}
279279
x.flatMap(f)
280280
}
281281
}
282282

283283
func bad(_ a : @escaping (Int)-> Int) -> Int { return 42 }
284-
func escapeNoEscapeResult(_ x: [Int]) -> (@noescape (Int) -> Int) -> Int { // expected-warning{{@noescape is the default and is deprecated}} {{43-52=}}
284+
func escapeNoEscapeResult(_ x: [Int]) -> (@noescape (Int) -> Int) -> Int { // expected-error{{@noescape is the default and has been removed}} {{43-52=}}
285285
return { f in // expected-note{{parameter 'f' is implicitly non-escaping}}
286286
bad(f) // expected-error {{passing non-escaping parameter 'f' to function expecting an @escaping closure}}
287287
}
@@ -292,7 +292,7 @@ func escapeNoEscapeResult(_ x: [Int]) -> (@noescape (Int) -> Int) -> Int { // ex
292292
//
293293

294294
// Old syntax -- @noescape is the default, and is redundant
295-
typealias CompletionHandlerNE = @noescape (_ success: Bool) -> () // expected-warning{{@noescape is the default and is deprecated}} {{33-43=}}
295+
typealias CompletionHandlerNE = @noescape (_ success: Bool) -> () // expected-error{{@noescape is the default and has been removed}} {{33-43=}}
296296

297297
// Explicit @escaping is not allowed here
298298
typealias CompletionHandlerE = @escaping (_ success: Bool) -> () // expected-error{{@escaping attribute may only be used in function parameter position}} {{32-42=}}
@@ -326,11 +326,11 @@ func doThing4(_ completion: @escaping CompletionHandler) {
326326

327327
// <rdar://problem/19997680> @noescape doesn't work on parameters of function type
328328
func apply<T, U>(_ f: @noescape (T) -> U, g: @noescape (@noescape (T) -> U) -> U) -> U {
329-
// expected-warning@-1{{@noescape is the default and is deprecated}} {{23-33=}}
330-
// expected-warning@-2{{@noescape is the default and is deprecated}} {{46-56=}}
331-
// expected-warning@-3{{@noescape is the default and is deprecated}} {{57-66=}}
329+
// expected-error@-1{{@noescape is the default and has been removed}} {{23-33=}}
330+
// expected-error@-2{{@noescape is the default and has been removed}} {{46-56=}}
331+
// expected-error@-3{{@noescape is the default and has been removed}} {{57-66=}}
332332
return g(f)
333-
// expected-warning@-1{{passing a non-escaping function parameter 'f' to a call to a non-escaping function parameter}}
333+
// expected-error@-1{{passing a non-escaping function parameter 'f' to a call to a non-escaping function parameter}}
334334
}
335335

336336
// <rdar://problem/19997577> @noescape cannot be applied to locals, leading to duplication of code
@@ -339,8 +339,8 @@ enum r19997577Type {
339339
case Function(() -> r19997577Type, () -> r19997577Type)
340340
case Sum(() -> r19997577Type, () -> r19997577Type)
341341

342-
func reduce<Result>(_ initial: Result, _ combine: @noescape (Result, r19997577Type) -> Result) -> Result { // expected-warning{{@noescape is the default and is deprecated}} {{53-63=}}
343-
let binary: @noescape (r19997577Type, r19997577Type) -> Result = { combine(combine(combine(initial, self), $0), $1) } // expected-warning{{@noescape is the default and is deprecated}} {{17-27=}}
342+
func reduce<Result>(_ initial: Result, _ combine: @noescape (Result, r19997577Type) -> Result) -> Result { // expected-error{{@noescape is the default and has been removed}} {{53-63=}}
343+
let binary: @noescape (r19997577Type, r19997577Type) -> Result = { combine(combine(combine(initial, self), $0), $1) } // expected-error{{@noescape is the default and has been removed}} {{17-27=}}
344344
switch self {
345345
case .Unit:
346346
return combine(initial, self)
@@ -354,15 +354,15 @@ enum r19997577Type {
354354

355355
// type attribute and decl attribute
356356
func noescapeD(@noescape f: @escaping () -> Bool) {} // expected-error {{attribute can only be applied to types, not declarations}}
357-
func noescapeT(f: @noescape () -> Bool) {} // expected-warning{{@noescape is the default and is deprecated}} {{19-29=}}
357+
func noescapeT(f: @noescape () -> Bool) {} // expected-error{{@noescape is the default and has been removed}} {{19-29=}}
358358
func noescapeG<T>(@noescape f: () -> T) {} // expected-error{{attribute can only be applied to types, not declarations}}
359359

360360
func autoclosureD(@autoclosure f: () -> Bool) {} // expected-error {{attribute can only be applied to types, not declarations}}
361361
func autoclosureT(f: @autoclosure () -> Bool) {} // ok
362362
func autoclosureG<T>(@autoclosure f: () -> T) {} // expected-error{{attribute can only be applied to types, not declarations}}
363363

364364
func noescapeD_noescapeT(@noescape f: @noescape () -> Bool) {} // expected-error {{attribute can only be applied to types, not declarations}}
365-
// expected-warning@-1{{@noescape is the default and is deprecated}} {{39-49=}}
365+
// expected-error@-1{{@noescape is the default and has been removed}} {{39-49=}}
366366

367367
func autoclosureD_noescapeT(@autoclosure f: @noescape () -> Bool) {} // expected-error {{attribute can only be applied to types, not declarations}}
368-
// expected-warning@-1{{@noescape is the default and is deprecated}} {{45-55=}}
368+
// expected-error@-1{{@noescape is the default and has been removed}} {{45-55=}}

0 commit comments

Comments
 (0)