mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 02:29:19 +02:00
* GetEnumName handles subrange types correctly, resolves #15377
git-svn-id: trunk@14461 -
This commit is contained in:
parent
04f0544570
commit
8cecea9b53
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10149,6 +10149,7 @@ tests/webtbs/tw15304.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1532.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15364.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15370.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15377.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw1539.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1567.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1573.pp svneol=native#text/plain
|
||||
|
@ -375,6 +375,7 @@ begin
|
||||
else
|
||||
begin
|
||||
PS:=@PT^.NameList;
|
||||
dec(Value,PT^.MinValue);
|
||||
While Value>0 Do
|
||||
begin
|
||||
PS:=PShortString(pointer(PS)+PByte(PS)^+1);
|
||||
|
13
tests/webtbs/tw15377.pp
Normal file
13
tests/webtbs/tw15377.pp
Normal file
@ -0,0 +1,13 @@
|
||||
program test;
|
||||
|
||||
uses typinfo;
|
||||
|
||||
Type
|
||||
E1 = (en1,en2,en3,en4,en5);
|
||||
E2 = en3..en5;
|
||||
begin
|
||||
if (GetEnumName(TypeInfo(E1),Ord(High(E1))) <> 'en5') then
|
||||
halt(1);
|
||||
if (GetEnumName(TypeInfo(E2),Ord(High(E2))) <> 'en5') then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user