WrapWithAdapterMethodCallFix use variable type for cast

Fixes failing GenericsHighlightingTest.testIDEA124019
This commit is contained in:
Tagir Valeev
2017-08-28 10:10:49 +07:00
parent 46a3c9c8fb
commit fd653d3ade
@@ -61,7 +61,8 @@ public class WrapWithAdapterMethodCallFix extends LocalQuickFixAndIntentionActio
!myOutTypeFilter.test(outType)) {
return false;
}
PsiType resultType = createReplacement(context, "((" + inType.getCanonicalText() + ")null)").getType();
PsiType resultType =
createReplacement(context, "((" + GenericsUtil.getVariableTypeByExpressionType(inType).getCanonicalText() + ")null)").getType();
return resultType != null && outType.isAssignableFrom(resultType);
}