Skip to content

Commit 609733b

Browse files
committed
[SE-0361] Update tests for bound generic extensions.
1 parent 01d4634 commit 609733b

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

test/ModuleInterface/specialized-extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name Test -enable-experimental-bound-generic-extensions
1+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name Test
22
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name Test
33
// RUN: %FileCheck %s < %t.swiftinterface
44

test/SILGen/mangling_specialized_extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-bound-generic-extensions %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
22

33
struct Tree<T> {
44
struct Branch<B> {

test/decl/ext/extensions.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ func nestingTest6() {
4040
extension Array {
4141
func foo() {
4242
extension Array { // expected-error {{declaration is only valid at file scope}}
43-
// FIXME: Confusing error
44-
// expected-error@-2 {{constrained extension must be declared on the unspecialized generic type 'Array' with constraints specified by a 'where' clause}}
4543
}
4644
}
4745
}
@@ -347,7 +345,8 @@ extension Tree.LimbContent.Contents {
347345
}
348346

349347
extension Tree.BoughPayload.Contents {
350-
// expected-error@-1 {{constrained extension must be declared on the unspecialized generic type 'Nest'}}
348+
// expected-error@-1 {{extension of type 'Tree.BoughPayload.Contents' (aka 'Nest<Int>') must be declared as an extension of 'Nest<Int>'}}
349+
// expected-note@-2 {{did you mean to extend 'Nest<Int>' instead?}}
351350
}
352351

353352
// SR-10466 Check 'where' clause when referencing type defined inside extension

test/decl/ext/generic.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ extension Double : P2 {
1919
}
2020

2121
extension X<Int, Double, String> {
22-
// expected-error@-1{{constrained extension must be declared on the unspecialized generic type 'X' with constraints specified by a 'where' clause}}
2322
let x = 0
2423
// expected-error@-1 {{extensions must not contain stored properties}}
2524
static let x = 0
26-
// expected-error@-1 {{static stored properties not supported in generic types}}
2725
func f() -> Int {}
2826
class C<T> {}
2927
}

test/decl/ext/specialize.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-bound-generic-extensions
1+
// RUN: %target-typecheck-verify-swift
22

33
extension Array<Int> {
44
func someIntFuncOnArray() {}

test/decl/typealias/generic.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ func takesSugaredType2(m: GenericClass<Int>.TA<Float>) {
307307
extension A {}
308308

309309
extension A<T> {} // expected-error {{generic type 'A' specialized with too few type parameters (got 1, but expected 2)}}
310-
extension A<Float,Int> {} // expected-error {{constrained extension must be declared on the unspecialized generic type 'MyType' with constraints specified by a 'where' clause}}
310+
extension A<Float,Int> {}
311311
extension C<T> {} // expected-error {{cannot find type 'T' in scope}}
312-
extension C<Int> {} // expected-error {{constrained extension must be declared on the unspecialized generic type 'MyType' with constraints specified by a 'where' clause}}
312+
extension C<Int> {}
313313

314314

315315
protocol ErrorQ {

0 commit comments

Comments
 (0)