| 123456789101112 |
- MODULE tfwdtype;
- // REJECTED BY DESIGN: a module-level forward type reference (a global
- // whose type is declared further down). Modula-2 requires declaration
- // before use; only a POINTER's base type may forward-reference. gm2
- // accepts this as a leniency. Expects "undeclared identifier".
- VAR g : Later;
- TYPE Later = RECORD x, y : INTEGER END;
- VAR ExitCode : INTEGER;
- BEGIN
- g.x := 40; g.y := 2;
- ExitCode := g.x + g.y
- END tfwdtype.
|