Generic type parameters are plain text part of method names. With this PR type parameters of methods are part of AST in the same way as they are in type declarations.
We may need to discuss how the implementations of generic methods are shown in AST.
Code:
procedure TGen<T>.Generate<T2>;
begin
end;
Currently the method's name attribute contains the entire method name TGen<T>.Generate<T2>. This is not the most elegant solution as someone would need to parse the name in order to get the generic type parameters and the name of the current class.
I didn't want to break existing projects using DelphiAST so I decided to remove only the method's generic parameters from the name and keep the rest of it untouched: The type name including its generic parameters remains still plain text.
Generic type parameters are plain text part of method names. With this PR type parameters of methods are part of AST in the same way as they are in type declarations.
Code:
AST:
We may need to discuss how the implementations of generic methods are shown in AST.
Code:
Currently the method's name attribute contains the entire method name
TGen<T>.Generate<T2>
. This is not the most elegant solution as someone would need to parse the name in order to get the generic type parameters and the name of the current class. I didn't want to break existing projects using DelphiAST so I decided to remove only the method's generic parameters from the name and keep the rest of it untouched: The type name including its generic parameters remains still plain text.AST: