[Oberon] Clarifying type compatibility in Oberon-07

Jörg joerg.straube at iaeth.ch
Thu Oct 5 12:52:20 CEST 2017


> So this is your understanding of *same type* in Oberon-07:
> 
> Two variables a and b with types Ta and Tb are of the same type if
> 1. Ta and Tb are both denoted by the same type identifier, or
> 2. Ta is declared to equal Tb in a type declaration of the form Ta = Tb, or
> 3. a and b appear in the same identifier list in a variable, record field, or formal parameter declaration and are not open arrays, or
> 4. Ta and Tb are pointer types whose pointer base types are the same, or
> 5. Ta and Tb are procedure types whose formal parameter lists match.

No. My understanding of "same type" is as in Oberon-2:

Two variables a and b with types Ta and Tb are of the same type if
1. Ta and Tb are both denoted by the same type identifier, or
2. Ta is declared to equal Tb in a type declaration of the form Ta = Tb, or
3. a and b appear in the same identifier list in a variable, record field, or formal parameter declaration and are not open arrays, or


Assignment rule 1 uses „same type". The things NOT covered by „same type“ are mentioned explicitly with own assignment rules.

4. Ta and Tb are pointer types whose pointer base types are the same, or
This rule is not needed, as it is covered by Assignment rule 4, assuming T is an extension of T itself.
5. Ta and Tb are procedure types whose formal parameter lists match.
This rule is not needed as it covered by Assignment rule 7.

br
Jörg


More information about the Oberon mailing list