mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 22:49:25 +02:00
* fix for Mantis #36114: when converting a static class field to a global variable the varspez of the field needs to be respected
+ added test git-svn-id: trunk@43116 -
This commit is contained in:
parent
b4e998b3f8
commit
beb606be13
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16063,6 +16063,7 @@ tests/webtbf/tw35753.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3583.pp svneol=native#text/plain
|
||||
tests/webtbf/tw35866.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw35981.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw36114.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw3626.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3631.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3643.pp svneol=native#text/plain
|
||||
|
@ -1960,7 +1960,7 @@ implementation
|
||||
|
||||
constructor tstaticvarsym.create_from_fieldvar(const n: string;fieldvar:tfieldvarsym);
|
||||
begin
|
||||
create(internal_static_field_name(n),vs_value,fieldvar.vardef,[]);
|
||||
create(internal_static_field_name(n),fieldvar.varspez,fieldvar.vardef,[]);
|
||||
fieldvarsym:=fieldvar;
|
||||
end;
|
||||
|
||||
|
22
tests/webtbf/tw36114.pp
Normal file
22
tests/webtbf/tw36114.pp
Normal file
@ -0,0 +1,22 @@
|
||||
{ %FAIL }
|
||||
|
||||
program tw36114;
|
||||
|
||||
{$mode objfpc}{$H+}{$J-}
|
||||
type
|
||||
TTestme=class
|
||||
strict private
|
||||
const
|
||||
{$push}{$writeableconst off} // superfluous but also doesn't work
|
||||
c_one:integer = 1;
|
||||
c_two:integer = 10;
|
||||
{$pop}
|
||||
public
|
||||
class property one:integer read c_one;
|
||||
class property two:integer read c_two;
|
||||
end;
|
||||
|
||||
begin
|
||||
TTestme.c_one := 1000;
|
||||
writeln(TTestme.One);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user