diff --git a/.gitattributes b/.gitattributes index 44c77d491d..b47d6f600b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10138,6 +10138,7 @@ tests/webtbf/tw17646a.pp svneol=native#text/plain tests/webtbf/tw1782.pp svneol=native#text/plain tests/webtbf/tw18096.pp svneol=native#text/pascal tests/webtbf/tw18096c.pp svneol=native#text/pascal +tests/webtbf/tw18267.pp svneol=native#text/plain tests/webtbf/tw1827.pp svneol=native#text/plain tests/webtbf/tw1830.pp svneol=native#text/plain tests/webtbf/tw1842.pp svneol=native#text/plain diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index 8ca9f1357f..c350fba605 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -1962,6 +1962,7 @@ implementation ( not(is_open_array(left.resultdef)) and not(is_array_constructor(left.resultdef)) and + not(is_array_of_const(left.resultdef)) and (left.resultdef.size=resultdef.size) and { disallow casts of const nodes } (not is_constnode(left) or diff --git a/tests/webtbf/tw18267.pp b/tests/webtbf/tw18267.pp new file mode 100644 index 0000000000..cec978336e --- /dev/null +++ b/tests/webtbf/tw18267.pp @@ -0,0 +1,15 @@ +{ %fail } + +program typecasttest; + +{$mode objfpc} + +procedure Test(const aArgs: array of const); +begin + TVarRec(aArgs); +end; + +begin + +end. +