How to resolve a baselang generic type correctly
Gentlemen,
i m just wondering how i should resolve a generic type correctly in a specific context. In my specific case, i do have a
thus, DynExtDocuSearchDelegateFactory implements ICustomDataUxElement<SearchCriteriaDocumentum>. That is correct!
Now what i want to come up with a typesystem rule, to see, what the TypeVariableReference T in ICustomDataUx<T> evaluates to (in the context of DynExtDocuSearchDelegateFactory).
Are there any MPS Utils around to evaluate the TypeVariableReference in the DynExtDocuSearchDelegateFactory context?
Any hint appreciated,
Daniel
Please sign in to leave a comment.
Not sure I understand the question. If you look at the supertypes of DynExtDocuSearchDelegateFactory you will find an instance of ClassifierType `ICustomDataUxElement<SearchCriteriaDocumentum>`. It contains the type SearchCriteriaDocumentum which is the substitution for T defined in DynamicListOfDelegates.
He Fedor,
that would be exactly, what is needed. I m looking for a method which returns a ClassifierType of ICustomDataUxElement<SearchCriteriaDocumentum> when provided with the DynExtDocuSearchDelegateFactory, without any presence of T.
nlist<ClassifiertType> subtypes = ?????? ( RefTo_DynExtDocusSearchDelegateFactory_Classifier )
Guess i m working within the typesystem aspect.......
Cheers,
Daniel
There is an expression 'immediateSupertypes()` defined in j.m.l.typesystem language. You can use DFS or BFS to navigate all supertypes. Keep in mind that the supertypes graph may contain cycles.
Cheers Fedor,
great !