{
Type source = sourceExp.expType;
Type realDest = dest;
+ Type backupSourceExpType = null;
if(dest.kind == pointerType && sourceExp.type == constantExp && !strtoul(sourceExp.constant, null, 0))
return true;
if(tempType._class)
MatchTypes(tempSource, tempDest, conversions, null, null, true, true, false, false);
- FreeType(sourceExp.expType);
+ // NOTE: To handle bad warnings on int64 vs 32 bit eda::Id incompatibilities
+ backupSourceExpType = sourceExp.expType;
sourceExp.expType = dest; dest.refCount++;
-
//sourceExp.expType = MkClassType(_class.fullName);
flag = true;
FreeType(source);
FreeType(dest);
+ if(backupSourceExpType) FreeType(backupSourceExpType);
return true;
}
}
FreeType(source);
if(inCompiler) FreeType(dest);
+ if(backupSourceExpType) FreeType(backupSourceExpType);
return true;
}
{
FreeType(source);
FreeType(dest);
+ if(backupSourceExpType)
+ {
+ // Failed to convert: revert previous exp type
+ if(sourceExp.expType) FreeType(sourceExp.expType);
+ sourceExp.expType = backupSourceExpType;
+ }
return false;
}
}
{
FreeType(source);
FreeType(dest);
+ if(backupSourceExpType)
+ {
+ // Failed to convert: revert previous exp type
+ if(sourceExp.expType) FreeType(sourceExp.expType);
+ sourceExp.expType = backupSourceExpType;
+ }
return false;
}
FreeType(dest);
FreeType(source);
+ if(backupSourceExpType) FreeType(backupSourceExpType);
+
return true;
}
else
}
else
{
- e.destType = type;
- if(type) type.refCount++;
+ if(type && type.kind == ellipsisType && type.prev && type.prev.kind == classType && type.prev.classObjectType)
+ {
+ e.destType = type.prev;
+ e.destType.refCount++;
+ }
+ else
+ {
+ e.destType = type;
+ if(type) type.refCount++;
+ }
}
// Don't reach the end for the ellipsis
if(type && type.kind != ellipsisType)