Internal error with boolean helper
Yaaaa, I'm regularly blundering into this error and now got around to reproducing it on a small example.
This code
{$mode objfpc} {$modeswitch typehelpers}
type
BoolHelper = type helper for boolean
function ToChar: char;
end;
function BoolHelper.ToChar: char;
begin
result := pChar('-+')[ord(self)];
end;
var
x: uint32;
begin
writeln((@x = @x).ToChar);
end.
spews out an ‘Internal error 2011010304
’ instead of compiling.
Edited by Rika