On Fri, 1 Aug 2003, Frank Heckenbach wrote:
These are for variables. Please add a few (not all combinations) for constants and type intializers.
Err, I tried but I've got something illegal. I think I'll need an example or two on these. (!!!)
I think constants require compile-time constants, so forget about them. Types (`type Foo = Bar value Baz') should be relevant, though. (You might have to declare a variable of the initialized type in order to provoke the range-check error.)
Revisiting type initializers: was this what was meant?
program mir046cu; {type with integer initializer out of bounds, upper} uses GPC;
procedure localProc; type Foo = Char Value 'c'; var a: Foo Value 'f'; begin end;
procedure ExpectError; begin if ExitCode = 0 then WriteLn ('failed') else begin WriteLn ('OK'); Halt (0) {!} end end;
begin AtExit(ExpectError); localProc; end.
Thanks, Mirsad