[fpc-devel] Assigning class methods, accessed via an object or helper type, to incompatible procvars

Blaise at blaise.ru Blaise at blaise.ru
Thu Dec 23 20:07:18 CET 2021


On 22.12.2021 21:16, Blaise wrote:
> 1) The attached metaclass_meth_to_procvar-1.patch fixes the internal error reported for:
> [ICE] Assigning class methods, accessed via a class reference type, to incompatible procvars
Also fixes:

1B) [ICE] Assigning class static methods, accessed via an object type, to incompatible procvars
-------8<-------
type O = object
	class procedure Static; static;
end;
class procedure O.Static; begin end;

var IncompatWStatic: procedure of object;
begin
	IncompatWStatic := O.Static // ICE 200301042
end.
-------8<-------

1C) [ICE] Assigning class methods, accessed via a helper type, to incompatible procvars
-------8<-------
type C = class end;
type H = class helper for C
	class procedure NonStatic;
	class procedure Static; static;
end;
class procedure H.NonStatic; begin end;
class procedure H.Static; begin end;

var IncompatWNonStatic: procedure;
var IncompatWStatic: procedure of object;
begin
	IncompatWNonStatic := H.NonStatic; // ICE 200301042
	IncompatWStatic := H.Static // ICE 200301042
end.
-------8<-------
See https://lists.freepascal.org/pipermail/fpc-devel/2021-December/044251.html for the discussion on rejecting such qualification.

-- 
βþ


More information about the fpc-devel mailing list