@@ -37,9 +37,11 @@ extension P {
37
37
38
38
_ = P . property // Ok
39
39
_ = P . property. other // Ok
40
+ _ = P . fnProp // Ok
40
41
_ = P . fnProp ( ) // Ok
41
42
_ = P . fnProp ( ) . other // Ok
42
43
_ = P . method ( ) // Ok
44
+ _ = P . method // Ok (partial application)
43
45
_ = P . method ( ) . other // Ok
44
46
_ = P . genericFn ( 42 ) // Ok
45
47
_ = P . genericFn ( 42 ) . other // Ok
@@ -50,8 +52,10 @@ _ = P[t: 42].other // Ok
50
52
51
53
let _: S = P . property // Ok
52
54
let _: S = P . property. other // Ok
55
+ let _: ( ) -> S = P . fnProp
53
56
let _: S = P . fnProp ( ) // Ok
54
57
let _: S = P . fnProp ( ) . other // Ok
58
+ let _: ( ) -> S = P . method // Ok
55
59
let _: S = P . method ( ) // Ok
56
60
let _: S = P . method ( ) . other // Ok
57
61
let _: G < Int > = P . genericFn ( 42 ) // Ok
@@ -113,7 +117,7 @@ test_combo(.genericFn(42)) // expected-error {{global function 'test_combo' requ
113
117
extension P {
114
118
static var invalidProp : Int { 42 } // expected-note 5 {{'invalidProp' declared here}}
115
119
static var selfProp : Self { fatalError ( ) }
116
- static func invalidMethod( ) -> Int { 42 } // expected-note 5 {{'invalidMethod()' declared here}}
120
+ static func invalidMethod( ) -> Int { 42 } // expected-note 6 {{'invalidMethod()' declared here}}
117
121
static func generic< T> ( _: T ) -> T { fatalError ( ) } // expected-note 5 {{'generic' declared here}}
118
122
static func genericWithReqs< T: Collection , Q> ( _: T ) -> Q where T. Element == Q { // expected-note 3 {{'genericWithReqs' declared here}} expected-note 3 {{required by static method 'genericWithReqs' where 'T' = '()'}}
119
123
fatalError ( )
@@ -129,6 +133,8 @@ _ = P.invalidProp
129
133
_ = P . invalidProp. other
130
134
// expected-error@-1 {{cannot reference static property 'invalidProp' on 'P.Protocol' with non-conforming result type 'Int'}}
131
135
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
136
+ _ = P . invalidMethod // Partial application with an invalid base type
137
+ // expected-error@-1 {{cannot reference static method 'invalidMethod()' on 'P.Protocol' with non-conforming result type 'Int'}}
132
138
_ = P . invalidMethod ( )
133
139
// expected-error@-1 {{cannot reference static method 'invalidMethod()' on 'P.Protocol' with non-conforming result type 'Int'}}
134
140
_ = P . invalidMethod ( ) . other
0 commit comments