| English | Português (Brasil) |
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, boolean, sprite, or
metasprite.nes_color valuenes_color values are limited to the NES palette range
$00..$3F in declarations, assignments, and every palette API.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, sprite, and metasprite
remain valid global types, they 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.nes.controller_down(true, nes.button_a) or a boolean button
argument.E4006 identifies the argument and its actual
type.$01 or $02 as the controller and exactly one
nes.button_* constant as the button.byte
values, while color arguments require nes_color. No implicit conversions
are performed.byte variable as a palette color.E4007 identifies the argument, actual type,
and required type.byte constant for indexes and an assigned
nes_color value for colors.sprite valuesprite is a strongly typed hardware OAM index and must
select one of the NES’s 64 entries.tests/fixtures/diagnostics/invalid_sprite_value.nsp, or declare or assign
a sprite value above $3F.E4008 identifies the invalid literal and the
supported $00..$3F range.$00 through $3F.metasprite valuemetasprite is an opaque static instance identity. A
hexadecimal number is not a metasprite instance or symbolic frame.tests/fixtures/diagnostics/invalid_metasprite_value.nsp, which assigns a
hexadecimal literal to a metasprite variable.E4009 rejects the literal without converting
it to an instance identity.nes.metasprite_create(imported.frame) to the variable.byte, boolean, or a
declared record as the element type.array[$00..$03] of nes_color.byte, boolean, or a declared record as the element
type.byte expression.boolean value.byte variable, literal, constant, or
arithmetic expression.Values[$08] when Values is declared as
array[$00..$07] of byte.Counter[$00] := $01 or Counter := Values.$00
and upper bound no greater than $FF.array[$01..$04] of byte.array[$00..$03] of byte.GameState = (Title, Playing, Title).State < Playing for an enum variable.= or <>, or model ordered state separately with a
byte if ordinal behavior is genuinely needed.Missing to a GameState variable.tests/fixtures/diagnostics/duplicate_record_field.nsp.tests/fixtures/diagnostics/unknown_record_field.nsp.tests/fixtures/diagnostics/field_access_on_non_record.nsp.byte, boolean, and
declared enumeration types. Arrays and nested records are not fields in this
milestone.tests/fixtures/diagnostics/unsupported_record_field_type.nsp.tests/fixtures/diagnostics/recursive_record_definition.nsp.$FF and be
truncated by 6502 indexed addressing.tests/fixtures/diagnostics/invalid_record_usage.nsp.byte or boolean; arrays, records, enums, and NES-specific handle types are not supported return values.tests/fixtures/diagnostics/unsupported_function_return_type.nsp.byte or boolean and store aggregate or hardware state in explicitly declared variables.