Inline function causes internal compiler error 2009112601

Original Reporter info from Mantis: ryan_joseph @genericptr
  • Reporter name: Ryan Joseph

Description:

Program below causes an internal compiler error

Steps to reproduce:

{$mode objfpc}

program test;

type
  TVec2 = record
    x, y: single;
  end;

function ViewToWorld (x, y: single): TVec2; overload;
begin  
  result.x := x;
  result.y := y;
end;

function ViewToWorld (pt: TVec2): TVec2; overload; inline;
begin
  result := ViewToWorld(pt.x, pt.y);
end;

var
  pt: TVec2;
begin
  // ERROR: Internal error 2009112601
  pt := ViewToWorld(pt);
end.

Mantis conversion info:

  • Mantis ID: 36381
  • Version: 3.3.1