fpc/tests/test/tprocvar18.pp
Sven/Sarah Barth 6a9b4a1b13 + apply patch by Blaise.ru: allow initialisation of method pointers with class methods (when class types are
known at compile time)
* adjust error message when a method pointer isn't suitable
+ add tests
2022-05-26 21:42:55 +02:00

19 lines
223 B
ObjectPascal

{ %FAIL }
program tprocvar18;
{$mode delphi}
type C = class
procedure Foo;
end;
procedure C.Foo; begin end;
type T = procedure of object;
var aC: C = nil;
// Still rejected:
var ViaInstance: T = aC.Foo;
begin
end.