From ec88f9a60ad8776e56945ebc3f4abc8ac85ab615 Mon Sep 17 00:00:00 2001 From: jonas Date: Sat, 20 Aug 2011 08:05:54 +0000 Subject: + 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 --- compiler/htypechk.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/htypechk.pas') 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 -- cgit v1.2.1