Browse Source

* fix Mantis #30494 by applying patch from Maciej Izak
+ added test

git-svn-id: trunk@34381 -

svenbarth 9 years ago
parent
commit
aaceb5518f
3 changed files with 23 additions and 4 deletions
  1. 1 0
      .gitattributes
  2. 7 4
      compiler/pexpr.pas
  3. 15 0
      tests/webtbf/tw30494.pp

+ 1 - 0
.gitattributes

@@ -13730,6 +13730,7 @@ tests/webtbf/tw2996.pp svneol=native#text/plain
 tests/webtbf/tw3000.pp svneol=native#text/plain
 tests/webtbf/tw30022.pp svneol=native#text/plain
 tests/webtbf/tw3047.pp svneol=native#text/plain
+tests/webtbf/tw30494.pp svneol=native#text/pascal
 tests/webtbf/tw3114.pp svneol=native#text/plain
 tests/webtbf/tw3116.pp svneol=native#text/plain
 tests/webtbf/tw3126.pp svneol=native#text/plain

+ 7 - 4
compiler/pexpr.pas

@@ -1456,10 +1456,13 @@ implementation
                     spezdef:=generate_specialization_phase2(spezcontext,tstoreddef(spezdef),false,'');
                     spezcontext.free;
                     spezcontext:=nil;
-                    srsym:=spezdef.typesym;
-                    srsymtable:=srsym.owner;
-                    check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg);
-                    result:=true;
+                    if spezdef<>generrordef then
+                      begin
+                        srsym:=spezdef.typesym;
+                        srsymtable:=srsym.owner;
+                        check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg);
+                        result:=true;
+                      end;
                   end;
                 else
                   internalerror(2015070302);

+ 15 - 0
tests/webtbf/tw30494.pp

@@ -0,0 +1,15 @@
+{ %FAIL }
+
+program tw30494;
+
+{$MODE DELPHI}
+
+type
+  TFoo<T: TObject> = record
+  end;
+
+var
+  foo: TFoo<Integer>;
+begin
+end.
+