It may well be a bug, not sure.
But you are trying to confuse the compiler on purpose.
The solution is easy:
{$mode objfpc}{$H+}
type
TMyType = array [0..15] of byte;
function Length(constref BA: TMyType): SizeInt;
begin
result := 0;
end;
begin
Writeln(System.Length('123'));// make it unambiguous.
end.
Note that if that code would be in a unit, there is no error and the system version is chosen.
Of course, if you change byte to char, your version is chosen provided you specify a result.
@Zvoni
Was easy to replicate on windows x86_64
Posts crossed.
It may very well be a platform bug.