[Bug]: mutator does not work for scalar type's templated arguments
Describe the bug
see the original issue: https://github.com/Azure/typespec-azure/issues/2684
Reproduction
write a templated scalar and mutate the type to see if the passed templated arguments are mutated.
Checklist
- [x] Follow our Code of Conduct
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- [x] The provided reproduction is a minimal reproducible example of the bug.
@tadelesh We couldn't repro this with arguments passed to a decorator, can you elaborate on the specific scenario that is blocked that requires inspecting the arguments to the scalar type?
it is happened for this type. when we get state from the parameterizedNextLinkConfig decorator of a mutated type, the returned type of ParameterizedParams is not mutated.
So I think there is first an issue with that type. You shouldn't be checking the template arguments(apart as a workaround for missing feature)
@Azure.Core.Foundations.Private.parameterizedNextLinkConfig(TypeSpec.Reflection.ModelProperty[])
scalar parameterizedNextLink<ParameterizedParams extends TypeSpec.Reflection.ModelProperty[]>
extends url;
but should be
@Azure.Core.Foundations.Private.parameterizedNextLinkConfig(ParameterizedParams)
scalar parameterizedNextLink<ParameterizedParams extends TypeSpec.Reflection.ModelProperty[]>
extends url;
then you get that as teh decorator param and don't need to check the templateArguments.
They might not be mutated and that probably needs to be fixed but I think this is a first a misuse of the type graph on the tcgc side.
Closing as it was
- a misue on the side of the decorator
- Decorator was actually using
templateArgumentswhich was a deprecated and now removed property which would explain why the mutator didn't mutate it Fixed the decorator correctly here https://github.com/Azure/typespec-azure/pull/2730
@timotheeguerin i tested your latest change and found the template parameter used in decorator is not mutated. i reopened this issue and change the title.
add a new test in tcgc to repro the issue: https://github.com/Azure/typespec-azure/pull/2734
hhm its weird, works fine with the @doc decorator but that decorator parameters seems to not be mutated
ah seems to maybe be tuples