mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 04:59:26 +02:00
* fix for Mantis #31201: don't write any RTTI for undefined defs (and while we're at it abort if an error def is encountered)
+ added test git-svn-id: trunk@35256 -
This commit is contained in:
parent
4b7d0eb0ac
commit
6b641394d0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -15334,6 +15334,7 @@ tests/webtbs/tw3109.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3111.pp svneol=native#text/plain
|
||||
tests/webtbs/tw31120.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3113.pp svneol=native#text/plain
|
||||
tests/webtbs/tw31201.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3124.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3131.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3137.pp svneol=native#text/plain
|
||||
|
@ -136,6 +136,12 @@ implementation
|
||||
if assigned(tprocdef(def).parast) then
|
||||
write_persistent_type_info(tprocdef(def).parast,false);
|
||||
end;
|
||||
errordef:
|
||||
{ we shouldn't have come this far if we have an errordef somewhere }
|
||||
internalerror(2017010701);
|
||||
undefineddef:
|
||||
{ don't write any RTTI for these }
|
||||
continue;
|
||||
end;
|
||||
{ always generate persistent tables for types in the interface so
|
||||
they can be reused in other units and give always the same pointer
|
||||
|
25
tests/webtbs/tw31201.pp
Normal file
25
tests/webtbs/tw31201.pp
Normal file
@ -0,0 +1,25 @@
|
||||
unit tw31201;
|
||||
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
Tuple<T> = record
|
||||
Item1: T;
|
||||
end;
|
||||
|
||||
Tuple = record
|
||||
class function Create<T>(Item1: T): Tuple<T>; overload; static;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
class function Tuple.Create<T>(Item1: T): Tuple<T>;
|
||||
begin
|
||||
Result.Item1:=Item1;
|
||||
end;
|
||||
|
||||
initialization
|
||||
Writeln(Tuple.Create<LongInt>(42).Item1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user