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

parameter doesn't match (SYSTEM.ADDRESS) #79

Open
aixp opened this issue Nov 15, 2019 · 2 comments
Open

parameter doesn't match (SYSTEM.ADDRESS) #79

aixp opened this issue Nov 15, 2019 · 2 comments

Comments

@aixp
Copy link

aixp commented Nov 15, 2019

MODULE A;

	IMPORT SYSTEM;

	TYPE
		T* = PROCEDURE (adr: SYSTEM.ADDRESS);

	PROCEDURE P* (t: T);
	BEGIN
	END P;

END A.
MODULE B;

	IMPORT SYSTEM, A;

	PROCEDURE P0 (adr: SYSTEM.ADDRESS);
	BEGIN
	END P0;

	PROCEDURE P;
	BEGIN
		A.P(P0)
	END P;

END B.
$ voc A.Mod B.Mod
A.Mod  Compiling A.  New symbol file.  339 chars.
B.Mod  Compiling B.

  11: 		A.P(P0)
             ^
    pos   113  err 115  parameter doesn't match

Module compilation failed.
$ voc | head -2 | tail -1
Oberon-2 compiler v2.1.0 [2019/11/15] for gcc LP64 on ubuntu.
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 19.04
Release:	19.04
Codename:	disco
@dcwbrown
Copy link
Contributor

Yes. Reproduces for me. I agree - I think it should work.

Here's a workaround:

MODULE A;
IMPORT SYSTEM;

TYPE
  ADDRESS* = SYSTEM.ADDRESS;
  T* = PROCEDURE (adr: ADDRESS);

  PROCEDURE P*(t: T);
  BEGIN
  END P;

END A.
MODULE B;
IMPORT SYSTEM, A;

  PROCEDURE P0(adr: A.ADDRESS);
  BEGIN
  END P0;

  PROCEDURE P;
  BEGIN
    A.P(P0)
  END P;

END B.
voc -s a.mod b.mod -m
a.mod  Compiling A.  340 chars.
b.mod  Compiling B.  Main program.  449 chars.

Will this work for you?

It may be the symbol fingerprinting code, that took me a long time to understand last time I needed to work on it, and I've forgotten everything I knew :-(.

Or it may be deeper - I think PROCEDURE type equivalence has some special case code.

-- Dave.

@aixp
Copy link
Author

aixp commented Nov 18, 2019

Yes, it works for me.

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

2 participants