summaryrefslogtreecommitdiff
path: root/compiler/htypechk.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-08-20 08:05:54 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-08-20 08:05:54 +0000
commitec88f9a60ad8776e56945ebc3f4abc8ac85ab615 (patch)
tree063351d0c8fe69dcee4435916111593988642b7c /compiler/htypechk.pas
parent81156ae82c663c2a1f6c0dfc5fd6e2772533d7fa (diff)
downloadfpc-ec88f9a60ad8776e56945ebc3f4abc8ac85ab615.tar.gz
+ dummy support for untyped var/const/out parameters on the JVM target
o includes basic "auto-boxing" infrastructure to support Delphi.NET- compatible untyped parameters as described at http://hallvards.blogspot.com/2007/10/dn4dp24-net-vs-win32-untyped-parameters.html git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18510 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/htypechk.pas')
-rw-r--r--compiler/htypechk.pas7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas
index 6d2e101541..82575de29f 100644
--- a/compiler/htypechk.pas
+++ b/compiler/htypechk.pas
@@ -1231,7 +1231,12 @@ implementation
- typecast from pointer to array }
fromdef:=ttypeconvnode(hp).left.resultdef;
todef:=hp.resultdef;
- if not((nf_absolute in ttypeconvnode(hp).flags) or
+ { in managed VMs, you cannot typecast formaldef when assigning
+ to it, see http://hallvards.blogspot.com/2007/10/dn4dp24-net-vs-win32-untyped-parameters.html }
+ if (target_info.system in systems_managed_vm) and
+ (fromdef.typ=formaldef) then
+ CGMessagePos(hp.fileinfo,type_e_no_managed_formal_assign_typecast)
+ else if not((nf_absolute in ttypeconvnode(hp).flags) or
(fromdef.typ=formaldef) or
is_void(fromdef) or
is_open_array(fromdef) or