From 6d3ae162671e90d6e25642ac7f16b3fb7ca30ab4 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 1 Jan 2006 20:43:28 +0000 Subject: [PATCH] * fixed web bug #4647 (untyped elements in array constructors) + test git-svn-id: trunk@2110 - --- .gitattributes | 1 + compiler/nld.pas | 4 +++- tests/webtbf/tw4647.pp | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/webtbf/tw4647.pp diff --git a/.gitattributes b/.gitattributes index b910d604d1..e85a7e39ac 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5941,6 +5941,7 @@ tests/webtbf/tw4569a.pp svneol=native#text/plain tests/webtbf/tw4569b.pp svneol=native#text/plain tests/webtbf/tw4619a.pp -text svneol=unset#text/plain tests/webtbf/tw4619b.pp svneol=native#text/plain +tests/webtbf/tw4647.pp svneol=native#text/plain tests/webtbf/tw4651.pp svneol=native#text/plain tests/webtbf/uw0744.pp svneol=native#text/plain tests/webtbf/uw0840a.pp svneol=native#text/plain diff --git a/compiler/nld.pas b/compiler/nld.pas index 98e0777886..80e7a3c247 100644 --- a/compiler/nld.pas +++ b/compiler/nld.pas @@ -970,7 +970,9 @@ implementation begin if is_integer(hp.left.resulttype.def) and not(is_64bitint(hp.left.resulttype.def)) then - hp.left:=ctypeconvnode.create(hp.left,s32inttype); + hp.left:=ctypeconvnode.create(hp.left,s32inttype) + else if is_void(hp.left.resulttype.def) then + CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename); end; floatdef : if not(is_currency(hp.left.resulttype.def)) then diff --git a/tests/webtbf/tw4647.pp b/tests/webtbf/tw4647.pp new file mode 100644 index 0000000000..68d91c2889 --- /dev/null +++ b/tests/webtbf/tw4647.pp @@ -0,0 +1,16 @@ +{ %fail } + +{$mode delphi} +program test; + +uses + SysUtils; + +procedure shiny; +begin +end; + +begin + Format('%s', [shiny()]); +end. +