|
@@ -2439,7 +2439,13 @@ implementation
|
|
|
{$ifdef llvm}
|
|
|
{ we still may have to insert a type conversion at the
|
|
|
llvm level }
|
|
|
- if left.resultdef<>resultdef then
|
|
|
+ if (left.resultdef<>resultdef) and
|
|
|
+ { if unspecialised generic -> we won't generate any code
|
|
|
+ for this, and keeping the type conversion node will
|
|
|
+ cause valid_for_assign to fail because the typecast will be from/to something of 0
|
|
|
+ bytes to/from something with a non-zero size }
|
|
|
+ not is_typeparam(left.resultdef) and
|
|
|
+ not is_typeparam(resultdef) then
|
|
|
result:=nil
|
|
|
else
|
|
|
{$endif llvm}
|