View Issue Details

IDProjectCategoryView StatusLast Update
0038827FPCCompilerpublic2021-04-30 07:00
Reporterdmz73 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformWin64OSWindows 
Product Version3.3.1 
Summary0038827: Error Undefined symbol .La?????? when using inlined generic methods from different unit
DescriptionUsing inlined generic functions from different unit causes error undefined symbol: .La?????
Steps To ReproduceCreate simple program:
program Project1;
{$mode delphi}
uses unit1;
var R: TRec;
begin
  R.GetArr<single>;
end.

Add unit1:
unit Unit1;
{$mode Delphi}
interface
type
  TRec = record
    C: TArray<single>;
    function GetArr<T>: TArray<T>; inline;
  end;
implementation
function TRec.GetArr<T>: TArray<T>;
begin
  result := nil;
  case GetTypeKind(T) of
    tkFloat:
      if SizeOf(T) = SizeOf(Single) then result := C;
  end;
end;
end.

Compile the program and following error is reported:
Error: Undefined symbol: .La17 (first seen in project1.o)

If all code is in the same unit then compile is successful.
program Project1;
{$mode delphi}
//uses unit1;
type
  TRec = record
    C: TArray<single>;
    function GetArr<T>: TArray<T>; inline;
  end;
  function TRec.GetArr<T>: TArray<T>;
  begin
    result := nil;
    case GetTypeKind(T) of
      tkFloat:
        if SizeOf(T) = SizeOf(Single) then result := C;
    end;
  end;
var R: TRec;
begin
  R.GetArr<single>;
end.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-04-30 07:00 dmz73 New Issue