Skip to content

GENERICS: Procedures do not compile in Blaise. Parse error: Bare reference to 'genericProc' requires () for a call . #217

Description

@Schmitty2005

UPDATE: Looking at the test, PROCEDURE Generics may not have been implemented/tested. Function Generics are working as expected!

Procedures with generics do not compile in blaise.

{$MODE DELPHI}
program gp;

procedure genericProc<T>(a, b : T);
begin
    writeln(a, ' ', b);
end;

begin
    genericProc<Integer>(10, 11);
end.
$ ./blaise --source gp.pas --output gp
Parse error: Bare reference to 'genericProc' requires () for a call at line 11 col 5 in gp.pas

FPC Output :

$ fpc gp.pas
Free Pascal Compiler version 3.2.2+dfsg-32 [2024/01/05] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling gp.pas
Linking gp
13 lines compiled, 0.0 sec

$ ./gp
10 11

FYI : This does work in blaise and FPC , because it is a generic function :

{$MODE DELPHI}
program gp;

//procedure genericProc<T>(a, b : T);
function genericProc<T>(a,b : T)  : T;
begin
    writeln(a, ' ', b);
    result := a+b;
end;

begin
    writeln(genericProc<Integer>(10, 11));
end.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions