@@ -56,8 +56,11 @@ extension S {
5656 ( self , { $0 } )
5757 }
5858
59+ // Note: qualified name base types are not yet serialized and are not printed
60+ // when round-tripping.
61+
5962 // CHECK: @derivative(of: instanceMethod, wrt: (self, x))
60- @derivative ( of: instanceMethod, wrt: ( self , x) )
63+ @derivative ( of: S . instanceMethod, wrt: ( self , x) )
6164 func derivativeInstanceMethodWrtAll( _ x: S ) -> ( value: S , differential: ( S , S ) -> S ) {
6265 ( self , { ( dself, dx) in self } )
6366 }
@@ -81,19 +84,39 @@ extension S {
8184
8285extension S {
8386 var computedProperty : S {
84- self
87+ get { self }
88+ set { }
8589 }
8690
8791 // CHECK: @derivative(of: computedProperty, wrt: self)
8892 @derivative ( of: computedProperty, wrt: self )
8993 func derivativeProperty( ) -> ( value: S , differential: ( S ) -> S ) {
9094 ( self , { $0 } )
9195 }
96+
97+ // CHECK: @derivative(of: computedProperty.get, wrt: self)
98+ @derivative ( of: computedProperty. get, wrt: self )
99+ func derivativePropertyGetter( ) -> ( value: S , pullback: ( S ) -> S ) {
100+ fatalError ( )
101+ }
102+
103+ // CHECK: @derivative(of: computedProperty.set, wrt: (self, newValue))
104+ @derivative ( of: computedProperty. set, wrt: ( self , newValue) )
105+ mutating func derivativePropertySetter( _ newValue: S ) -> (
106+ value: ( ) , pullback: ( inout S ) -> S
107+ ) {
108+ fatalError ( )
109+ }
92110}
93111
94112// Test subscripts.
95113
96114extension S {
115+ subscript( ) -> S {
116+ get { self }
117+ set { }
118+ }
119+
97120 subscript< T: Differentiable > ( x: T ) -> S {
98121 self
99122 }
@@ -103,4 +126,18 @@ extension S {
103126 func derivativeSubscript< T: Differentiable > ( x: T ) -> ( value: S , differential: ( S ) -> S ) {
104127 ( self , { $0 } )
105128 }
129+
130+ // CHECK: @derivative(of: subscript.get, wrt: self)
131+ @derivative ( of: subscript. get, wrt: self )
132+ func derivativeSubscriptGetter( ) -> ( value: S , pullback: ( S ) -> S ) {
133+ fatalError ( )
134+ }
135+
136+ // CHECK: @derivative(of: subscript.set, wrt: (self, newValue))
137+ @derivative ( of: subscript. set, wrt: ( self , newValue) )
138+ mutating func derivativeSubscriptSetter( _ newValue: S ) -> (
139+ value: ( ) , pullback: ( inout S ) -> S
140+ ) {
141+ fatalError ( )
142+ }
106143}
0 commit comments