// We don't check anything in that case.
if (!isThisPtr || !isNewObj)
{
- GenTreePtr arg = impStackTop(stackIndex).val;
+ GenTreePtr arg = impStackTop(stackIndex).val;
+ var_types argType = arg->TypeGet();
var_types expectedArgType;
if (argIndex < fixedArgCnt)
{
// The type of the argument will be genActualType(*baseType).
expectedArgType = genActualType(*baseType);
+ argType = genActualType(argType);
}
}
else
expectedArgType = *baseType;
}
- var_types argType = arg->TypeGet();
if (!isThisPtr && argType == TYP_I_IMPL)
{
// The reference implementation has a constructor that takes a pointer.