// Specifically for method invocations we check if the return type is
// a type parameter and if so if one of the type arguments is erased,
// in that case we mark the expression itself as erased as well
if (that.getPrimary() instanceof StaticMemberOrTypeExpression) {
StaticMemberOrTypeExpression expr = (StaticMemberOrTypeExpression)that.getPrimary();
if (expr.getDeclaration() instanceof Method) {
Method mth = (Method)expr.getDeclaration();
if (isTypeParameter(mth.getType())
&& hasErasedTypeParameter(expr.getTarget(), expr.getTypeArguments().getTypeModels())) {
CodegenUtil.markTypeErased(that);
CodegenUtil.markUntrustedType(that);
}
}
}