Spivoxity / obc-3

Oxford Oberon-2 compiler
38 stars 7 forks source link

Exported record fields should be writable in Oberon07 #4

Closed Spivoxity closed 5 years ago

Spivoxity commented 5 years ago

In Oberon07, with

MODULE M1; TYPE rec = RECORD x: INTEGER; END; VAR s*: rec; ...

MODULE M2; IMPORT M1; VAR r: M1.rec; BEGIN r.x := 7; M1.s.x := 8; ...

the assignment to r.x should be allowed, but that to M1.s.x should not. At present, both are forbidden.

Spivoxity commented 5 years ago

Note that in Wirth's implementation, an assigment M1.p^.x := 9 is also forbidden, where M1.p is an exported pointer variable, though the sequence

q := M1.p; q^.x := 9

is allowed. That looks like a bug.

Spivoxity commented 5 years ago

Resolved in 3.0.1