You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/decl/protocol/existential_member_accesses_self_assoctype_fixit.swift
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,12 @@ protocol P {
12
12
protocolQ{}
13
13
14
14
do{
15
-
func test(p:P){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
15
+
func test(p:P){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
16
16
p.method(false) // expected-error {{member 'method' cannot be used on value of type 'any P'; consider using a generic constraint instead}} {{-1:16--1:17=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P>}} {{none}}
17
17
}
18
18
}
19
19
do{
20
-
func test(p:((P))){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
20
+
func test(p:((P))){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
21
21
p.method(false) // expected-error {{member 'method' cannot be used on value of type 'any P'; consider using a generic constraint instead}} {{-1:18--1:19=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P>}} {{none}}
22
22
}
23
23
}
@@ -57,12 +57,12 @@ do {
57
57
}
58
58
}
59
59
do{
60
-
func test(p:P.Type){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
60
+
func test(p:P.Type){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
61
61
p.staticMethod(false) // expected-error {{member 'staticMethod' cannot be used on value of type 'any P.Type'; consider using a generic constraint instead}} {{-1:16--1:17=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P>}} {{none}}
62
62
}
63
63
}
64
64
do{
65
-
func test(p:(P).Type){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
65
+
func test(p:(P).Type){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
66
66
p.staticMethod(false) // expected-error {{member 'staticMethod' cannot be used on value of type 'any (P).Type'; consider using a generic constraint instead}} {{-1:17--1:18=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P>}} {{none}}
67
67
}
68
68
}
@@ -78,12 +78,12 @@ do {
78
78
}
79
79
80
80
do{
81
-
func test(p:P&Q){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
81
+
func test(p:P&Q){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
82
82
p.method(false) // expected-error {{member 'method' cannot be used on value of type 'any P & Q'; consider using a generic constraint instead}} {{-1:16--1:21=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P & Q>}} {{none}}
83
83
}
84
84
}
85
85
do{
86
-
func test(p:((P&Q))){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
86
+
func test(p:((P&Q))){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
87
87
p.method(false) // expected-error {{member 'method' cannot be used on value of type 'any P & Q'; consider using a generic constraint instead}} {{-1:18--1:23=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P & Q>}} {{none}}
88
88
}
89
89
}
@@ -123,12 +123,12 @@ do {
123
123
}
124
124
}
125
125
do{
126
-
func test(p:(P&Q).Type){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
126
+
func test(p:(P&Q).Type){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
127
127
p.staticMethod(false) // expected-error {{member 'staticMethod' cannot be used on value of type 'any (P & Q).Type'; consider using a generic constraint instead}} {{-1:16--1:23=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P & Q>}} {{none}}
128
128
}
129
129
}
130
130
do{
131
-
func test(p:((P&Q)).Type){ // expected-warning {{protocol 'P' as a type must be explicitly marked as 'any'}}
131
+
func test(p:((P&Q)).Type){ // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
132
132
p.staticMethod(false) // expected-error {{member 'staticMethod' cannot be used on value of type 'any ((P & Q)).Type'; consider using a generic constraint instead}} {{-1:18--1:23=<#generic parameter name#>}} {{-1:12--1:12=<<#generic parameter name#>: P & Q>}} {{none}}
// expected-warning@-1 {{checking a value with optional type 'T?' against type 'any P1' succeeds whenever the value is non-nil; did you mean to use '!= nil'?}}
447
447
}
448
448
func j(_ x :C1)->Bool{
449
-
return x is P1 // expected-warning {{protocol 'P1' as a type must be explicitly marked as 'any'}}
449
+
return x is P1 // expected-warning {{use of protocol 'P1' as a type must be written 'any P1'}}
Copy file name to clipboardExpand all lines: test/decl/protocol/recursive_requirement.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ protocol AsExistentialB {
91
91
}
92
92
93
93
protocolAsExistentialAssocTypeA{
94
-
vardelegate:AsExistentialAssocTypeB?{get} // expected-warning {{protocol 'AsExistentialAssocTypeB' as a type must be explicitly marked as 'any'}}
94
+
vardelegate:AsExistentialAssocTypeB?{get} // expected-warning {{use of protocol 'AsExistentialAssocTypeB' as a type must be written 'any AsExistentialAssocTypeB'}}
func aMethod(_ object :AsExistentialAssocTypeAgainA) // expected-warning {{protocol 'AsExistentialAssocTypeAgainA' as a type must be explicitly marked as 'any'}}
106
+
func aMethod(_ object :AsExistentialAssocTypeAgainA) // expected-warning {{use of protocol 'AsExistentialAssocTypeAgainA' as a type must be written 'any AsExistentialAssocTypeAgainA'}}
func testConstraintAlias(x:Constraint){} // expected-warning{{'Constraint' (aka 'Input') as a type must be explicitly marked as 'any'}}{{29-39=any Constraint}}
256
+
func testConstraintAlias(x:Constraint){} // expected-warning{{use of 'Constraint' (aka 'Input') as a type must be written 'any Constraint'}}{{29-39=any Constraint}}
0 commit comments