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
{{ message }}
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
// expected-note @+1 {{candidate is missing explicit '@differentiable' attribute to satisfy requirement 'internalMethod1' (in protocol 'Protocol1'); explicit attribute is necessary because candidate is declared in a different type context or file than the conformance of 'ConformingStruct' to 'Protocol1'}} {{3-3=@differentiable }}
36
+
func internalMethod1(_ x:Float)->Float{
37
+
x
38
+
}
39
+
40
+
// Error for missing `@differentiable` superset attribute.
41
+
// expected-note @+2 {{candidate is missing explicit '@differentiable' attribute to satisfy requirement 'internalMethod2' (in protocol 'Protocol1'); explicit attribute is necessary because candidate is declared in a different type context or file than the conformance of 'ConformingStruct' to 'Protocol1'}} {{3-3=@differentiable }}
42
+
@differentiable(wrt: x)
43
+
func internalMethod2(_ x:Float)->Float{
44
+
x
45
+
}
46
+
47
+
// Error for missing `@differentiable` subset attribute.
48
+
// expected-note @+2 {{candidate is missing explicit '@differentiable(wrt: x)' attribute to satisfy requirement 'internalMethod3' (in protocol 'Protocol1'); explicit attribute is necessary because candidate is declared in a different type context or file than the conformance of 'ConformingStruct' to 'Protocol1'}} {{3-3=@differentiable(wrt: x) }}
// expected-note @+1 {{protocol requires function 'callAsFunction' with type '(Float) -> Float'}}
6
+
func callAsFunction(_ input:Float)->Float
7
+
}
8
+
9
+
protocolP2:P1{}
10
+
11
+
extensionP2{
12
+
@differentiable(wrt:(self, input))
13
+
// expected-note @+1 {{candidate is missing explicit '@differentiable(wrt: self)' attribute to satisfy requirement 'callAsFunction' (in protocol 'P1'); explicit attribute is necessary because candidate is declared in a different type context or file than the conformance of 'ConformingStruct' to 'P1'}}
0 commit comments