PsiSubstitutor: behavior changed 2017.2 -> 2018.1

I have some hierarachy:

 

class Base<R, C> {}

class Middle<R> extends Base<@Nullable R, String>{}

class Child<R> extends Middle<R>{}

Child<String> field;

 

Having PsiField I need to resolve Base generic arg for R - in example it should be @Nullable String

I used this method:

PsiClass psiBaseClass = findClass(project, Base.class.getCanonicalName())

TypeConversionUtil.getSuperClassSubstitutor(psiBaseClass, field.getType())
.substitute(psiBaseClass.getTypeParameters()[0]);

and in 2017.2 I got correct result - @Nullable String

but in 2018.1 I got simply String.

 

Is this an intended behavior and if so how could I resolve annotations during substitutions?

 

0
1 comment

This is bug. Fixed for 2018.2.

Thanks

0

Please sign in to leave a comment.