Right now, we are making some optimistic decision or early decision to work around recursive types.
This is because Glutinum is trying to get a full view of the AST, meaning that code like below with result in a maximum call stack because MyClass tries to get AST of MyUnion which tries to get the AST of MyClass and so on.
export declare class MyClass {
contains(otherBoundsOrLatLng: MyUnion | string): boolean;
}
export type MyUnion = MyClass | string;
I think we should find a way to compute a unique ID for a type and store that type AST in a dictionary. This way, when handling TypeReference we should hopefully be able to look into that dictionary for the information we need and not try to recursively handle the types.
Places impacted by this refactor (non exhaustive):
Right now, we are making some optimistic decision or early decision to work around recursive types.
This is because Glutinum is trying to get a full view of the AST, meaning that code like below with result in a maximum call stack because
MyClass
tries to get AST ofMyUnion
which tries to get the AST ofMyClass
and so on.I think we should find a way to compute a unique ID for a type and store that type AST in a dictionary. This way, when handling
TypeReference
we should hopefully be able to look into that dictionary for the information we need and not try to recursively handle the types.Places impacted by this refactor (non exhaustive):