From 0f9b8c8936904c93d1e994d0d381308b3df030a9 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 23 Mar 2012 20:32:40 +0000 Subject: [PATCH] * don't throw an error if a non-generic is tried to be specialized, resolves #21238 git-svn-id: trunk@20607 - --- .gitattributes | 1 + compiler/ptype.pas | 3 ++- tests/webtbf/tw21238.pp | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/webtbf/tw21238.pp diff --git a/.gitattributes b/.gitattributes index 2de6c0760f..40b939d1a8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11334,6 +11334,7 @@ tests/webtbf/tw20907.pp svneol=native#text/plain tests/webtbf/tw20907a.pp svneol=native#text/plain tests/webtbf/tw21078.pp svneol=native#text/plain tests/webtbf/tw21087.pp svneol=native#text/plain +tests/webtbf/tw21238.pp svneol=native#text/pascal tests/webtbf/tw2128.pp svneol=native#text/plain tests/webtbf/tw2129.pp svneol=native#text/plain tests/webtbf/tw21466.pas svneol=native#text/pascal diff --git a/compiler/ptype.pas b/compiler/ptype.pas index 5df541e436..eb662085f4 100644 --- a/compiler/ptype.pas +++ b/compiler/ptype.pas @@ -922,7 +922,8 @@ implementation begin generate_specialization(def,false,name,nil,''); { handle nested types } - post_comp_expr_gendef(def); + if assigned(def) then + post_comp_expr_gendef(def); end else begin diff --git a/tests/webtbf/tw21238.pp b/tests/webtbf/tw21238.pp new file mode 100644 index 0000000000..176035655d --- /dev/null +++ b/tests/webtbf/tw21238.pp @@ -0,0 +1,12 @@ +{ %fail } +{$mode delphi} +uses + classes; +procedure FormShow(Sender: TObject); +var + List: TList; +begin +end; + +begin +end.