Skip to content

Procedure cannot be called from body of function #20

@amir734jj

Description

@amir734jj

"Descriptional Composition of Compiler Components":

A.2.8 Function Declarations
Procedures, types, or variables declared outside the scope of the function cannot
be called, modified, or defined respectively inside the body of the function

Example:

  procedure identity_procedure(arg : Integer) : Integer begin
    -- Good. we can can a function from procedure
    result := identity_function(arg);
  end;

  function identity_function(arg: Integer) : Integer begin
    -- Bad. we should not be able to call a procedure from function
    result := identity_procedure(arg);
  end;

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