Re: [fpc-devel] virtual override with diff in default ?

2024-10-22 Thread n7800 via fpc-devel
Let me also share the results of tests for method pointers with different default values. The example is a bit convoluted, but it shows all possible combinations. It turns out that any component event definition always overrides the default values ​​from the class.   program Project1; type   TT

Re: [fpc-devel] virtual override with diff in default ?

2024-10-22 Thread Sven Barth via fpc-devel
Martin Frb via fpc-devel schrieb am Di., 22. Okt. 2024, 23:28: > Is the below meant to be allowed? > It compiles, it also compiles if you have no default in the base, but a > default in the sub class. > > type >TFoo = class > procedure Bar (const Item: String; AnObject: TObject = nil); v

[fpc-devel] virtual override with diff in default ?

2024-10-22 Thread Martin Frb via fpc-devel
Is the below meant to be allowed? It compiles, it also compiles if you have no default in the base, but a default in the sub class. type   TFoo = class     procedure Bar (const Item: String; AnObject: TObject = nil); virtual;   end;   TFoo2 = class(TFoo)     procedure Bar (const Item: String; A