@@ -706,7 +706,7 @@ protocol ProtocolRequirements: Differentiable {
706
706
}
707
707
708
708
protocol ProtocolRequirementsRefined : ProtocolRequirements {
709
- // expected-error @+1 {{overriding declaration is missing attribute '@differentiable'}}
709
+ // expected-error @+1 {{overriding declaration is missing attribute '@differentiable'}} {{3-3=@differentiable }}
710
710
func f1( _ x: Float ) -> Float
711
711
}
712
712
@@ -719,39 +719,39 @@ struct DiffAttrConformanceErrors: ProtocolRequirements {
719
719
var y : Float
720
720
721
721
// FIXME(TF-284): Fix unexpected diagnostic.
722
- // expected-note @+2 {{candidate is missing attribute '@differentiable'}}
722
+ // expected-note @+2 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
723
723
// expected-note @+1 {{candidate has non-matching type '(x: Float, y: Float)'}}
724
724
init ( x: Float , y: Float ) {
725
725
self . x = x
726
726
self . y = y
727
727
}
728
728
729
729
// FIXME(TF-284): Fix unexpected diagnostic.
730
- // expected-note @+2 {{candidate is missing attribute '@differentiable'}}
730
+ // expected-note @+2 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
731
731
// expected-note @+1 {{candidate has non-matching type '(x: Float, y: Int)'}}
732
732
init ( x: Float , y: Int ) {
733
733
self . x = x
734
734
self . y = Float ( y)
735
735
}
736
736
737
- // expected-note @+2 {{candidate is missing attribute '@differentiable'}}
737
+ // expected-note @+2 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
738
738
// expected-note @+1 {{candidate has non-matching type '(Float, Float) -> Float'}}
739
739
func amb( x: Float , y: Float ) -> Float {
740
740
return x
741
741
}
742
742
743
- // expected-note @+2 {{candidate is missing attribute '@differentiable(wrt: x)'}}
743
+ // expected-note @+2 {{candidate is missing attribute '@differentiable(wrt: x)'}} {{3-3=@differentiable(wrt: x) }}
744
744
// expected-note @+1 {{candidate has non-matching type '(Float, Int) -> Float'}}
745
745
func amb( x: Float , y: Int ) -> Float {
746
746
return x
747
747
}
748
748
749
- // expected-note @+1 {{candidate is missing attribute '@differentiable'}}
749
+ // expected-note @+1 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
750
750
func f1( _ x: Float ) -> Float {
751
751
return x
752
752
}
753
753
754
- // expected-note @+2 {{candidate is missing attribute '@differentiable'}}
754
+ // expected-note @+2 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
755
755
@differentiable ( wrt: ( self , x) )
756
756
func f2( _ x: Float , _ y: Float ) -> Float {
757
757
return x + y
@@ -774,15 +774,15 @@ protocol ProtocolRequirementsWithDefault {
774
774
func f1( _ x: Float ) -> Float
775
775
}
776
776
extension ProtocolRequirementsWithDefault {
777
- // expected-note @+1 {{candidate is missing attribute '@differentiable'}}
777
+ // expected-note @+1 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
778
778
func f1( _ x: Float ) -> Float { x }
779
779
}
780
780
// expected-error @+1 {{type 'DiffAttrConformanceErrors2' does not conform to protocol 'ProtocolRequirementsWithDefault'}}
781
781
struct DiffAttrConformanceErrors2 : ProtocolRequirementsWithDefault {
782
782
typealias TangentVector = DummyTangentVector
783
783
mutating func move( along _: TangentVector ) { }
784
784
785
- // expected-note @+1 {{candidate is missing attribute '@differentiable'}}
785
+ // expected-note @+1 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
786
786
func f1( _ x: Float ) -> Float { x }
787
787
}
788
788
@@ -794,7 +794,7 @@ protocol NotRefiningDiffable {
794
794
795
795
// expected-error @+1 {{type 'CertainlyNotDiffableWrtSelf' does not conform to protocol 'NotRefiningDiffable'}}
796
796
struct CertainlyNotDiffableWrtSelf : NotRefiningDiffable {
797
- // expected-note @+1 {{candidate is missing attribute '@differentiable'}}
797
+ // expected-note @+1 {{candidate is missing attribute '@differentiable'}} {{3-3=@differentiable }}
798
798
func a( _ x: Float ) -> Float { return x * 5.0 }
799
799
}
800
800
@@ -813,7 +813,7 @@ struct TF285MissingOneDiffAttr: TF285 {
813
813
814
814
// Requirement is missing an attribute.
815
815
@differentiable ( wrt: x)
816
- // expected-note @+1 {{candidate is missing attribute '@differentiable(wrt: (x, y))}}
816
+ // expected-note @+1 {{candidate is missing attribute '@differentiable(wrt: (x, y))}} {{3-3=@differentiable(wrt: (x, y)) }}
817
817
func foo( x: Float , y: Float ) -> Float {
818
818
return x
819
819
}
@@ -1047,7 +1047,7 @@ public protocol DifferentiableDistribution: Differentiable, Distribution {
1047
1047
// Adding a more general `@differentiable` attribute.
1048
1048
public protocol DoubleDifferentiableDistribution : DifferentiableDistribution
1049
1049
where Value: Differentiable {
1050
- // expected-error @+1 {{overriding declaration is missing attribute '@differentiable(wrt: self)'}}
1050
+ // expected-error @+1 {{overriding declaration is missing attribute '@differentiable(wrt: self)'}} {{3-3=@differentiable(wrt: self) }}
1051
1051
func logProbability( of value: Value ) -> Float
1052
1052
}
1053
1053
@@ -1137,8 +1137,8 @@ class Super: Differentiable {
1137
1137
}
1138
1138
1139
1139
class Sub : Super {
1140
- // expected-error @+2 {{overriding declaration is missing attribute '@differentiable(wrt: x)'}}
1141
- // expected-error @+1 {{overriding declaration is missing attribute '@differentiable'}}
1140
+ // expected-error @+2 {{overriding declaration is missing attribute '@differentiable(wrt: x)'}} {{12-12=@differentiable(wrt: x) }}
1141
+ // expected-error @+1 {{overriding declaration is missing attribute '@differentiable'}} {{12-12=@differentiable }}
1142
1142
override func testMissingAttributes( _ x: Float ) -> Float { x }
1143
1143
1144
1144
// expected-warning @+2 {{'jvp:' and 'vjp:' arguments in '@differentiable' attribute are deprecated}}
0 commit comments