Type-system diagnostics use the E4000-E4999 range.
Trigger:
Counter: word;
Expected compiler output:
E4001 demo.nsp:1:10
Unknown type: word.
nes_color, byte, or boolean.nes_color valuenes_color values are limited to the NES palette range
$00..$3F.Trigger:
BackgroundColor := $80;
Expected compiler output:
E4002 demo.nsp:1:20
Value $80 is not valid for type nes_color.
Allowed range: $00..$3F.
$00 through $3F.byte valuebyte occupies one byte and cannot represent values above
$FF.Trigger:
Counter := $100;
Expected compiler output:
E4003 demo.nsp:1:12
Value $100 is not valid for type byte.
Allowed range: $00..$FF.
$00 through $FF.byte. Comparison
operands must follow the comparison operator’s type rules, and Boolean
operators require boolean operands. Increment/decrement targets and
amounts, plus for control variables and bounds, must have type byte.
Procedure arguments must exactly match their corresponding byte or
boolean parameter types.Trigger:
Counter := Active;
Expected compiler output:
E4004 demo.nsp:1:12
Cannot assign a value of type boolean to variable Counter of type byte.
The source and target types must match.
true or false for a boolean literal, and use arithmetic only with byte
values. Compare matching types, and use not, and, and or only with
boolean values.byte and boolean. Although nes_color remains a valid type for
constants and global variables, it cannot be used for a parameter yet.Trigger:
procedure SetColor(Color: nes_color);
begin
end;
Expected compiler output:
E4005 demo.nsp:1:27
Type nes_color is not supported for procedure parameters.
byte or boolean, or
keep an nes_color value in global state.