diff --git a/bugs/bug0291.pp b/bugs/bug0291.pp new file mode 100644 index 0000000000..5e229794f2 --- /dev/null +++ b/bugs/bug0291.pp @@ -0,0 +1,25 @@ +{$mode tp} + +function ReturnString: string; +begin + ReturnString := 'A string'; +end; + +procedure AcceptString(S: string); +begin + WriteLn('Got: ', S); +end; + +type + TStringFunc = function: string; + +const + SF: TStringFunc = ReturnString; +var + S2: TStringFunc; +begin + @S2:=@ReturnString; + AcceptString(ReturnString); + AcceptString(SF); + AcceptString(S2); +end. diff --git a/bugs/readme.txt b/bugs/readme.txt index c6b4ee3fcd..32d52a0b08 100644 --- a/bugs/readme.txt +++ b/bugs/readme.txt @@ -339,6 +339,7 @@ Fixed bugs: bug0286.pp #$08d not allowed as Char constant OK 0.99.13 (PFV) bug0287.pp (true > false) not supported OK 0.99.13 (PFV) bug0288.pp crash with virtual method in except part OK 0.99.13 (PFV) + bug0291.pp @procvar in tp mode bugs OK 0.99.13 (PFV) Unproducable bugs: ------------------ @@ -378,4 +379,4 @@ bug0275.pp too many warnings bug0277.pp typecasting with const not possible bug0281.pp dup id checking with property is wrong bug0289.pp no hint/note for unused types -bug0290.pp problem with storing hex numbers in integers \ No newline at end of file +bug0290.pp problem with storing hex numbers in integers