The Oberon-2 language report "The Programming Language Oberon–2" has the following definition in appendix A:
Two variables a and b with types Ta and Tb are of the same type if
- Ta and Tb are both denoted by the same type identifier, or
- Ta is declared to equal Tb in a type declaration of the form Ta = Tb, or
- a and b appear in the same identifier list in a variable, record field, or formal parameter declaration and are not open arrays.
Given the type declarations
Ta = INTEGER
Tb = INTEGER
Tc = Tb
paragraph two in the above definition suggests that
- Ta and Tb are different types (no declaration of Ta = Tb),
- Ta and Tc are different types (no declaration of Ta = Tc) and
- Tc and INTEGER are different types (no declaration of Tc = INTEGER).
Is this a correct interpretation of same type in Oberon-2? As far as I understand, Oberon-2 is quite strict when it comes to name equivalence, and in this context the interpretation actually makes sense. What about Standard Pascal and ISO Modula-2?