Browse Source

* allow typeconversions of formaldef to anything else (make sure to
transform into an as-node when converting into a class/array type)

git-svn-id: branches/jvmbackend@18580 -

Jonas Maebe 14 years ago
parent
commit
528882dc68
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/jvm/njvmcnv.pas

+ 7 - 0
compiler/jvm/njvmcnv.pas

@@ -630,6 +630,7 @@ implementation
           types }
         procvarconv:=isvalidprocvartypeconv(left.resultdef,resultdef);
         fromclasscompatible:=
+          (left.resultdef.typ=formaldef) or
           (left.resultdef.typ=pointerdef) or
           (left.resultdef.typ=objectdef) or
           is_dynamic_array(left.resultdef) or
@@ -687,6 +688,12 @@ implementation
             exit;
           end;
 
+        { a formaldef can be converted to anything, but not on the assignment
+          side }
+        if (left.resultdef.typ=formaldef) and
+           not assignment_side then
+          exit;
+
         { don't allow conversions between different classes of primitive types,
           except for a few special cases }