[Oberon] Should hidden re-imports be able to coexist with identifiers

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Thu May 13 16:33:19 CEST 2021


The following reports a “mult def” error in PO 2013 when compiling M2

  MODULE M0;
    TYPE T0* = RECORD i: INTEGER END ;
  END M0.

  MODULE M1;
    IMPORT M0;
    TYPE T1* = RECORD (M0.T0) j: INTEGER END ;
  END M1.

  MODULE M2;
    IMPORT M1;  (*re-imports M0.T0*)
    VAR M0: INTEGER;  (* <--- "mult def” error message*)
  END M2.

In PO2013 this error is reported because the symbol table headed
by topScope *also* contains the re-imported module M0 (which is
a bit unfortunate) -- but ORB.NewObj does not check that fact.

I my mind, M2 should compile with no error message. i.e. hidden
re-imports should be able to coexist with regular identifiers (since
one cannot refer to re-imported objects by name anyway).

Comments?




More information about the Oberon mailing list