Browse Source

* don't throw an error if a non-generic is tried to be specialized, resolves #21238

git-svn-id: trunk@20607 -
florian 13 years ago
parent
commit
0f9b8c8936
3 changed files with 15 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/ptype.pas
  3. 12 0
      tests/webtbf/tw21238.pp

+ 1 - 0
.gitattributes

@@ -11334,6 +11334,7 @@ tests/webtbf/tw20907.pp svneol=native#text/plain
 tests/webtbf/tw20907a.pp svneol=native#text/plain
 tests/webtbf/tw20907a.pp svneol=native#text/plain
 tests/webtbf/tw21078.pp svneol=native#text/plain
 tests/webtbf/tw21078.pp svneol=native#text/plain
 tests/webtbf/tw21087.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/tw2128.pp svneol=native#text/plain
 tests/webtbf/tw2129.pp svneol=native#text/plain
 tests/webtbf/tw2129.pp svneol=native#text/plain
 tests/webtbf/tw21466.pas svneol=native#text/pascal
 tests/webtbf/tw21466.pas svneol=native#text/pascal

+ 2 - 1
compiler/ptype.pas

@@ -922,7 +922,8 @@ implementation
                      begin
                      begin
                        generate_specialization(def,false,name,nil,'');
                        generate_specialization(def,false,name,nil,'');
                        { handle nested types }
                        { handle nested types }
-                       post_comp_expr_gendef(def);
+                       if assigned(def) then
+                         post_comp_expr_gendef(def);
                      end
                      end
                    else
                    else
                      begin
                      begin

+ 12 - 0
tests/webtbf/tw21238.pp

@@ -0,0 +1,12 @@
+{ %fail }
+{$mode delphi}
+uses
+  classes;
+procedure FormShow(Sender: TObject);
+var
+  List: TList<Byte>;
+begin
+end;
+
+begin
+end.