I have a class with class-level generic. Let's say class A <T extends Number>. Inside the class there is a method: void m(T num). After converting "num" type into PsiType I'm getting PsiClassReferenceType.
But this PsiClassReferenceType cannot be used later. IDEA gives me an error: expected T but got Long. So here I believe I have to build type on my own.
Now I'm looking for a way how to define a PsiType that will hold something like "<T extends Number>".
So far I found PsiWildcardType and it allows me to specify generic like this: <? extends Number>, but it would be better to keep consistency to have a type with variable name.
P.S. Or maybe there is a way how to use PsiClassReferenceType properly so that IDEA will not give me this error of types mismatch.