@@ -46,30 +46,29 @@ struct Unrelated {}
46
46
47
47
//
48
48
// If a class conforms to a protocol concretely, the resulting protocol
49
- // composition type should be equivalent to the class type.
50
- //
51
- // FIXME: Disabled for now.
49
+ // composition type should be equivalent to the class type for redeclaration
50
+ // checking purposes.
52
51
//
53
52
54
- func alreadyConforms< T> ( _: Base < T > ) { } // expected-note {{'alreadyConforms' previously declared here}}
55
- func alreadyConforms< T> ( _: Base < T > & P1 ) { } // FIXME e/xpected -error {{invalid redeclaration of 'alreadyConforms'}} expected-note {{'alreadyConforms' previously declared here }}
53
+ func alreadyConforms< T> ( _: Base < T > ) { } // expected-note 3 {{'alreadyConforms' previously declared here}}
54
+ func alreadyConforms< T> ( _: Base < T > & P1 ) { } // expected -error {{invalid redeclaration of 'alreadyConforms'}}
56
55
func alreadyConforms< T> ( _: Base < T > & AnyObject ) { } // expected-error {{invalid redeclaration of 'alreadyConforms'}}
57
56
func alreadyConforms< T> ( _: Base < T > & P1 & AnyObject ) { } // expected-error {{invalid redeclaration of 'alreadyConforms'}}
58
57
59
- func alreadyConformsMeta< T> ( _: Base < T > . Type ) { } // expected-note {{'alreadyConformsMeta' previously declared here}}
60
- func alreadyConformsMeta< T> ( _: ( Base < T > & P1 ) . Type) { } // FIXME e/xpected -error {{invalid redeclaration of 'alreadyConformsMeta'}} expected-note {{'alreadyConformsMeta' previously declared here }}
61
- func alreadyConformsMeta< T> ( _: ( Base < T > & P1 ) . Protocol) { } // FIXME e/xpected -error {{invalid redeclaration of 'alreadyConformsMeta'}} expected-note 3 {{'alreadyConformsMeta' previously declared here }}
58
+ func alreadyConformsMeta< T> ( _: Base < T > . Type ) { } // expected-note 7 {{'alreadyConformsMeta' previously declared here}}
59
+ func alreadyConformsMeta< T> ( _: ( Base < T > & P1 ) . Type) { } // expected -error {{invalid redeclaration of 'alreadyConformsMeta'}}
60
+ func alreadyConformsMeta< T> ( _: ( Base < T > & P1 ) . Protocol) { } // expected -error {{invalid redeclaration of 'alreadyConformsMeta'}}
62
61
func alreadyConformsMeta< T> ( _: ( any Base < T > & P1 ) . Type) { } // expected-error {{invalid redeclaration of 'alreadyConformsMeta'}}
63
62
func alreadyConformsMeta< T> ( _: ( Base < T > & AnyObject ) . Type) { } // expected-error {{invalid redeclaration of 'alreadyConformsMeta'}}
64
63
func alreadyConformsMeta< T> ( _: ( Base < T > & P1 & AnyObject ) . Type) { } // expected-error {{invalid redeclaration of 'alreadyConformsMeta'}}
65
64
func alreadyConformsMeta< T> ( _: ( Base < T > & P1 & AnyObject ) . Protocol) { } // expected-error {{invalid redeclaration of 'alreadyConformsMeta'}}
66
65
func alreadyConformsMeta< T> ( _: ( any Base < T > & P1 & AnyObject ) . Type) { } // expected-error {{invalid redeclaration of 'alreadyConformsMeta'}}
67
66
68
- func alreadyConforms( _: P3 ) { } // e/xpected -note {{'alreadyConforms' previously declared here}}
69
- func alreadyConforms( _: P3 & AnyObject ) { } // FIXME e/xpected -error {{invalid redeclaration of 'alreadyConforms'}}
67
+ func alreadyConforms( _: P3 ) { } // expected -note {{'alreadyConforms' previously declared here}}
68
+ func alreadyConforms( _: P3 & AnyObject ) { } // expected -error {{invalid redeclaration of 'alreadyConforms'}}
70
69
71
- func alreadyConformsMeta( _: P3 . Type ) { } // FIXME e/xpected -note {{'alreadyConformsMeta' previously declared here}}
72
- func alreadyConformsMeta( _: ( P3 & AnyObject ) . Type) { } // FIXME ex/pected -error {{invalid redeclaration of 'alreadyConformsMeta'}}
70
+ func alreadyConformsMeta( _: P3 . Type ) { } // expected -note {{'alreadyConformsMeta' previously declared here}}
71
+ func alreadyConformsMeta( _: ( P3 & AnyObject ) . Type) { } // expected -error {{invalid redeclaration of 'alreadyConformsMeta'}}
73
72
74
73
// SE-0156 stipulates that a composition can contain multiple classes, as long
75
74
// as they are all the same.
0 commit comments