Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A procedure that returns a result cannot be used as an operator #106

Closed
Oleg-N-Cher opened this issue Aug 27, 2021 · 1 comment
Closed

Comments

@Oleg-N-Cher
Copy link
Owner

GameHunter reports:

MODULE Ex;

TYPE
  Rec0 = EXTENSIBLE RECORD
  END;

  Rec1 = RECORD (Rec0)
    i:INTEGER;
  END;

PROCEDURE as_Rec1 (VAR r:Rec0): POINTER TO Rec1;
  BEGIN
    RETURN NIL
  END as_Rec1;

PROCEDURE Process (VAR r:Rec0);
  BEGIN
    as_Rec1(r)^.i:=0;
  END Process;

END Ex.

(left side Online Oberon-07, right side Ofront 1.4 for BlackBox):

image

We found out that such use of a procedure as an operator can be valid only in Component Pascal.

@Oleg-N-Cher
Copy link
Owner Author

Vlad Folts encountered this problem while developing his Oberon compiler and fixed this point in his own Eberon dialect.

Oleg-N-Cher added a commit that referenced this issue Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant