@@ -3857,16 +3857,6 @@ ERROR(differentiable_attr_duplicate,none,
3857
3857
" duplicate '@differentiable' attribute with same parameters" , ())
3858
3858
NOTE(differentiable_attr_duplicate_note,none,
3859
3859
" other attribute declared here" , ())
3860
- ERROR(differentiable_attr_function_not_same_type_context,none,
3861
- " %0 is not defined in the current type context" , (DeclNameRef))
3862
- ERROR(differentiable_attr_derivative_not_function,none,
3863
- " registered derivative %0 must be a 'func' declaration" , (DeclNameRef))
3864
- ERROR(differentiable_attr_class_derivative_not_final,none,
3865
- " class member derivative must be final" , ())
3866
- ERROR(differentiable_attr_invalid_access,none,
3867
- " derivative function %0 is required to either be public or "
3868
- " '@usableFromInline' because the original function %1 is public or "
3869
- " '@usableFromInline'" , (DeclNameRef, DeclName))
3870
3860
ERROR(differentiable_attr_protocol_req_where_clause,none,
3871
3861
" '@differentiable' attribute on protocol requirement cannot specify "
3872
3862
" 'where' clause" , ())
@@ -3880,7 +3870,7 @@ ERROR(differentiable_attr_empty_where_clause,none,
3880
3870
" empty 'where' clause in '@differentiable' attribute" , ())
3881
3871
ERROR(differentiable_attr_where_clause_for_nongeneric_original,none,
3882
3872
" 'where' clause is valid only when original function is generic %0" ,
3883
- (DeclName ))
3873
+ (const ValueDecl * ))
3884
3874
ERROR(differentiable_attr_layout_req_unsupported,none,
3885
3875
" '@differentiable' attribute does not yet support layout requirements" ,
3886
3876
())
@@ -3890,7 +3880,7 @@ NOTE(protocol_witness_missing_differentiable_attr_invalid_context,none,
3890
3880
" candidate is missing explicit '%0' attribute to satisfy requirement %1 "
3891
3881
" (in protocol %3); explicit attribute is necessary because candidate is "
3892
3882
" declared in a different type context or file than the conformance of %2 "
3893
- " to %3" , (StringRef, DeclName , Type, Type))
3883
+ " to %3" , (StringRef, const ValueDecl * , Type, Type))
3894
3884
3895
3885
// @derivative
3896
3886
ERROR(derivative_attr_expected_result_tuple,none,
@@ -3908,11 +3898,12 @@ ERROR(derivative_attr_result_value_not_differentiable,none,
3908
3898
" '@derivative(of:)' attribute requires function to return a two-element "
3909
3899
" tuple; first element type %0 must conform to 'Differentiable'" , (Type))
3910
3900
ERROR(derivative_attr_result_func_type_mismatch,none,
3911
- " function result's %0 type does not match %1" , (Identifier, DeclName))
3901
+ " function result's %0 type does not match %1" ,
3902
+ (Identifier, const ValueDecl *))
3912
3903
NOTE(derivative_attr_result_func_type_mismatch_note,none,
3913
3904
" %0 does not have expected type %1" , (Identifier, Type))
3914
3905
NOTE(derivative_attr_result_func_original_note,none,
3915
- " %0 defined here" , (DeclName ))
3906
+ " %0 defined here" , (const ValueDecl * ))
3916
3907
ERROR(derivative_attr_not_in_same_file_as_original,none,
3917
3908
" derivative not in the same file as the original function" , ())
3918
3909
ERROR(derivative_attr_original_stored_property_unsupported,none,
@@ -3934,7 +3925,7 @@ NOTE(derivative_attr_protocol_requirement_unsupported,none,
3934
3925
" cannot yet register derivative default implementation for protocol "
3935
3926
" requirements" , ())
3936
3927
ERROR(derivative_attr_original_already_has_derivative,none,
3937
- " a derivative already exists for %0" , (DeclName ))
3928
+ " a derivative already exists for %0" , (const ValueDecl * ))
3938
3929
NOTE(derivative_attr_duplicate_note,none,
3939
3930
" other attribute declared here" , ())
3940
3931
ERROR(derivative_attr_access_level_mismatch,none,
@@ -3943,31 +3934,29 @@ ERROR(derivative_attr_access_level_mismatch,none,
3943
3934
" %select{private|fileprivate|internal|package|public|open}3, "
3944
3935
" but original function %0 is "
3945
3936
" %select{private|fileprivate|internal|package|public|open}1" ,
3946
- (/* original*/ DeclName , /* original*/ AccessLevel,
3947
- /* derivative*/ DeclName , /* derivative*/ AccessLevel))
3937
+ (/* original*/ const ValueDecl * , /* original*/ AccessLevel,
3938
+ /* derivative*/ const ValueDecl * , /* derivative*/ AccessLevel))
3948
3939
NOTE(derivative_attr_fix_access,none,
3949
3940
" mark the derivative function as "
3950
3941
" '%select{private|fileprivate|internal|package|@usableFromInline|@usableFromInline}0' "
3951
3942
" to match the original function" , (AccessLevel))
3952
3943
ERROR(derivative_attr_static_method_mismatch_original,none,
3953
3944
" unexpected derivative function declaration; "
3954
3945
" %0 requires the derivative function %1 to be %select{an instance|a 'static'}2 method" ,
3955
- (/* original*/ DeclName , /* derivative*/ DeclName ,
3946
+ (/* original*/ const ValueDecl * , /* derivative*/ const ValueDecl * ,
3956
3947
/* originalIsStatic*/ bool ))
3957
3948
NOTE(derivative_attr_static_method_mismatch_original_note,none,
3958
3949
" original function %0 is %select{an instance|a 'static'}1 method" ,
3959
- (/* original*/ DeclName , /* originalIsStatic*/ bool ))
3950
+ (/* original*/ const ValueDecl * , /* originalIsStatic*/ bool ))
3960
3951
NOTE(derivative_attr_static_method_mismatch_fix,none,
3961
3952
" make derivative function %0 %select{an instance|a 'static'}1 method" ,
3962
- (/* derivative*/ DeclName , /* mustBeStatic*/ bool ))
3953
+ (/* derivative*/ const ValueDecl * , /* mustBeStatic*/ bool ))
3963
3954
3964
3955
// @transpose
3965
3956
ERROR(transpose_attr_invalid_linearity_parameter_or_result,none,
3966
3957
" cannot transpose with respect to original %select{result|parameter}1 "
3967
3958
" '%0' that does not conform to 'Differentiable' and satisfy "
3968
3959
" '%0 == %0.TangentVector'" , (StringRef, /* isParameter*/ bool ))
3969
- ERROR(transpose_attr_overload_not_found,none,
3970
- " could not find function %0 with expected type %1" , (DeclName, Type))
3971
3960
ERROR(transpose_attr_cannot_use_named_wrt_params,none,
3972
3961
" cannot use named 'wrt' parameters in '@transpose(of:)' attribute, found "
3973
3962
" %0" , (Identifier))
@@ -3980,14 +3969,14 @@ NOTE(transpose_attr_wrt_self_self_type_mismatch_note,none,
3980
3969
ERROR(transpose_attr_static_method_mismatch_original,none,
3981
3970
" unexpected transpose function declaration; "
3982
3971
" %0 requires the transpose function %1 to be %select{an instance|a 'static'}2 method" ,
3983
- (/* original*/ DeclName , /* transpose*/ DeclName ,
3972
+ (/* original*/ const ValueDecl * , /* transpose*/ const ValueDecl * ,
3984
3973
/* originalIsStatic*/ bool ))
3985
3974
NOTE(transpose_attr_static_method_mismatch_original_note,none,
3986
3975
" original function %0 is %select{an instance|a 'static'}1 method" ,
3987
- (/* original*/ DeclName , /* originalIsStatic*/ bool ))
3976
+ (/* original*/ const ValueDecl * , /* originalIsStatic*/ bool ))
3988
3977
NOTE(transpose_attr_static_method_mismatch_fix,none,
3989
3978
" make transpose function %0 %select{an instance|a 'static'}1 method" ,
3990
- (/* transpose*/ DeclName , /* mustBeStatic*/ bool ))
3979
+ (/* transpose*/ const ValueDecl * , /* mustBeStatic*/ bool ))
3991
3980
3992
3981
// Automatic differentiation attributes
3993
3982
ERROR(autodiff_attr_original_decl_ambiguous,none,
@@ -4019,7 +4008,8 @@ ERROR(autodiff_attr_opaque_result_type_unsupported,none,
4019
4008
4020
4009
// differentiation `wrt` parameters clause
4021
4010
ERROR(diff_function_no_parameters,none,
4022
- " %0 has no parameters to differentiate with respect to" , (DeclName))
4011
+ " %0 has no parameters to differentiate with respect to" ,
4012
+ (const ValueDecl *))
4023
4013
ERROR(diff_params_clause_param_name_unknown,none,
4024
4014
" unknown parameter name %0" , (Identifier))
4025
4015
ERROR(diff_params_clause_self_instance_method_only,none,
0 commit comments