Contents | Prev | Next | Index


Assignment Compatibility

An expression e of type te is assignment compatible with a variable v of type Tv if one of the following conditions holds:

  1. Te and Tv are the same type.
  2. Te and Tv are compatible basic types, subranges or enumerations and Tv includes Te.
  3. Te and Tv are cardinal or integer types or subranges thereof and SIZE(Tv) >= SIZE(Te).
  4. Te and Tv are record types and Te is an extension of Tv and the dynamic type of v is Tv.
  5. Te and Tv are pointer types and Te is an extension of Tv.
  6. Tv is a pointer type or procedure type and e is NIL.
  7. Tv is ARRAY [0..n-1] OF CHAR, e is a string constant with m characters, and m <= n.
  8. Tv is a procedure type and e is the name of a procedure whose formal parameters match those of Tv.


Contents | Prev | Next | Index

Canterbury Modula-2 for Java  (Last documentation update Feb 8, 2000)
Copyright © 1998 Mill Hill & Canterbury Corporation, Ltd. All rights reserved
Please send any comments or corrections to mhc@webcom.com