Compiler can't determine what function to call lazarus / 21-General ---------------------------------------------------------------------- LemonParty · 2025-02-03 14:07 Hello. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$mode objfpc}{$H+} type        TMyType = array [0..15] of Byte; function Length(constref BA: TMyType): SizeInt;begin end; begin        Writeln(                Length('123')        );end.Compiler version 3.2.2. Is this bug or what? ---------------------------------------------------------------------- Zvoni · 2025-02-03 14:47 C&P your code i don't get "Compiler can't determine what function to call" i get "project1.lpr(14,29) Error: Incompatible type for arg no. 1: Got "Constant String", expected "TMyType"" So what's your question? Were you expecting the code to call the "standard" length-Function? In that case prepend your call with "System" Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i System.Length('123') ---------------------------------------------------------------------- Thaddy · 2025-02-03 14:47 It may well be a bug, not sure. But you are trying to confuse the compiler on purpose. The solution is easy:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$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. ---------------------------------------------------------------------- Thaddy · 2025-02-03 14:54 It is not platform, so it is a bug. Work-around obvious, but a byte is not a char in Pascal. ---------------------------------------------------------------------- PascalDragon · 2025-02-04 21:35 Quote from: LemonParty on February 03, 2025, 03:07:49 pmIs this bug or what? Normally you could solve this by declaring your Length function as overload, however due to System.Length being a compiler intrinsic and not a regular function this does not work. Thus you need to explicitly use System.Length to solve this.