On Thu, Feb 17, 2005 at 05:27:30AM +0100, Frank Heckenbach wrote: [...]
- Initialized types in record and object fields and in schemata work now. (inirec[24].pas, fjf1016*.pas)
The following schema definition does not compile.
[~/pas]% cat tstsch.pas program Test (output);
type colour = (red, yellow, green, blue); { from ISO 10206, 6.4.10 } colour_map (formal_discriminant: colour) = record case formal_discriminant of red: (red_field: integer value ord (red)); yellow: (yellow_field: integer value ord (yellow)); green: (green_field: integer value ord (green)); blue: (blue_field: integer value ord (blue)); end; cmap_blue = colour_map (blue);
const cb = cmap_blue [case blue of [blue_field: 42]];
var cg: colour_map (green);
begin if (cb.blue_field = 42) and (cg.green_field = 2) then writeln ('OK') else writeln ('failed') end. [~/pas]% gpc34 -v Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/specs Configured with: ../gcc-3.4.3/configure --enable-languages=pascal --program-suffix=34 Thread model: posix gpc version 20050217, based on gcc-3.4.3 [~/pas]% gpc34 tstsch.pas tstsch.pas:13: error: undeclared identifier `red_field' (first use in this routine) tstsch.pas:13: error: (Each undeclared identifier is reported only once tstsch.pas:13: error: for each routine it appears in.) tstsch.pas:13: error: undeclared identifier `yellow_field' (first use in this routine) tstsch.pas:13: error: undeclared identifier `green_field' (first use in this routine) tstsch.pas:13: error: undeclared identifier `blue_field' (first use in this routine)
And another bug:
[~/pas]% cat test.p program foo;
type t = array [0..32765] of integer;
var m: ^t;
begin new (m) end. [~/pas]% gpc34 test.p [~/pas]% ./a.out ./a.out: value out of range (error #300 at 804ef2a)
Emil