Skip to content

Commit 0bcdf75

Browse files
Suyash SrijanSuyash Srijan
authored andcommitted
[test] update diagnostics in existing tests
1 parent d85b02c commit 0bcdf75

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

test/Constraints/generics.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,7 @@ protocol SR_7984_HasAssoc {
660660
}
661661

662662
struct SR_7984_X<T: SR_7984_HasAssoc> {}
663-
extension SR_7984_X where T.Assoc.Foo: String {} // expected-error {{type 'T.Assoc.Foo' constrained to non-protocol, non-class type 'String'}} // expected-note {{use 'T.Assoc.Foo == String' to require 'T.Assoc.Foo' to be 'String'}} {{38-39= ==}}
664-
665-
struct S<T: Sequence> where T.Element: String {} // expected-error {{type 'T.Element' constrained to non-protocol, non-class type 'String'}} expected-note {{use 'T.Element == String' to require 'T.Element' to be 'String'}} {{38-39= ==}}
666-
func F<T: Sequence>(foo: T) where T.Element: String {} // expected-error {{type 'T.Element' constrained to non-protocol, non-class type 'String'}} expected-note {{use 'T.Element == String' to require 'T.Element' to be 'String'}} {{44-45= ==}}
663+
extension SR_7984_X where T.Assoc.Foo: String {} // expected-error {{type 'T.Assoc.Foo' constrained to non-protocol, non-class type 'String'}} expected-note {{use 'T.Assoc.Foo == String' to require 'T.Assoc.Foo' to be 'String'}} {{38-39= ==}}
667664

665+
struct SR_7984_S<T: Sequence> where T.Element: String {} // expected-error {{type 'T.Element' constrained to non-protocol, non-class type 'String'}} expected-note {{use 'T.Element == String' to require 'T.Element' to be 'String'}} {{46-47= ==}}
666+
func SR_7984_F<T: Sequence>(foo: T) where T.Element: String {} // expected-error {{type 'T.Element' constrained to non-protocol, non-class type 'String'}} expected-note {{use 'T.Element == String' to require 'T.Element' to be 'String'}} {{52-53= ==}}

test/NameBinding/scope_map_lookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protocol P1 {
2626
protocol AProtocol {
2727
associatedtype e : e
2828
// expected-error@-1 {{inheritance from non-protocol, non-class type 'Self.e'}}
29-
// expected-error@-2 {{type 'Self.e' constrained to non-protocol, non-class type 'Self.e'}}
29+
// expected-error@-2 {{type 'Self.e' constrained to non-protocol, non-class type 'Self.e'}} expected-note@-2 {{use 'e == Self.e' to require 'e' to be 'Self.e'}} {{22-23===}}
3030
}
3131

3232
// Extensions.

test/Sema/circular_decl_checking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var TopLevelVar: TopLevelVar? { return nil } // expected-error {{use of undeclar
4646
// FIXME: The first error is redundant and isn't correct in what it states.
4747
protocol AProtocol {
4848
associatedtype e : e
49-
// expected-error@-1 {{type 'Self.e' constrained to non-protocol, non-class type 'Self.e'}}
49+
// expected-error@-1 {{type 'Self.e' constrained to non-protocol, non-class type 'Self.e'}} expected-note@-1 {{use 'e == Self.e' to require 'e' to be 'Self.e'}} {{22-23===}}
5050
// expected-error@-2 {{inheritance from non-protocol, non-class type 'Self.e'}}
5151
}
5252

test/decl/protocol/req/unsatisfiable.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ protocol Base {
4343
// same type.
4444
protocol Sub1: Base {
4545
associatedtype SubAssoc: Assoc
46-
// expected-error@-1 {{type 'Self.SubAssoc' constrained to non-protocol, non-class type 'Self.Assoc'}}
46+
// expected-error@-1 {{type 'Self.SubAssoc' constrained to non-protocol, non-class type 'Self.Assoc'}} expected-note@-1 {{use 'SubAssoc == Self.Assoc' to require 'SubAssoc' to be 'Self.Assoc'}} {{28-33===}}
4747
// expected-error@-2 {{inheritance from non-protocol, non-class type 'Self.Assoc'}}
4848
}
4949

5050
// FIXME: This error is incorrect in what it states.
5151
protocol Sub2: Base {
52-
associatedtype SubAssoc where SubAssoc: Assoc // expected-error {{type 'Self.SubAssoc' constrained to non-protocol, non-class type 'Self.Assoc'}}
52+
associatedtype SubAssoc where SubAssoc: Assoc // expected-error {{type 'Self.SubAssoc' constrained to non-protocol, non-class type 'Self.Assoc'}} expected-note {{use 'SubAssoc == Self.Assoc' to require 'SubAssoc' to be 'Self.Assoc'}} {{41-42= ==}}
5353
}
5454

5555
struct S {}
5656

5757
// FIX-ME: One of these errors is redundant.
5858
protocol P4 {
5959
associatedtype X : S
60-
// expected-error@-1 {{type 'Self.X' constrained to non-protocol, non-class type 'S'}}
60+
// expected-error@-1 {{type 'Self.X' constrained to non-protocol, non-class type 'S'}} expected-note@-1 {{use 'X == S' to require 'X' to be 'S'}} {{22-23===}}
6161
// expected-error@-2 {{inheritance from non-protocol, non-class type 'S'}}
6262
}
6363

6464
protocol P5 {
65-
associatedtype Y where Y : S // expected-error {{type 'Self.Y' constrained to non-protocol, non-class type 'S'}}
65+
associatedtype Y where Y : S // expected-error {{type 'Self.Y' constrained to non-protocol, non-class type 'S'}} expected-note {{use 'Y == S' to require 'Y' to be 'S'}} {{28-29===}}
6666
}

0 commit comments

Comments
 (0)