Section: §1.7.1 Integer literal typing
Current text:
States integer literals are typed as the smallest of Integer/Cardinal/Int64/UInt64 that fits, uniformly across notations.
Problem:
In practice, Delphi's literal typing may differ by notation: decimal literals that overflow Integer are typed Int64 (not Cardinal), whereas hex/binary/octal literals of the same magnitude can be typed Cardinal since they're read as bit patterns rather than signed magnitudes. This nuance may be missing from the current uniform description.
Why this needs compiler verification:
This project already verifies lexical claims via compiler fixtures (see tests/Fixtures). Test the inferred type of a decimal literal like 3000000000 vs. the hex equivalent $B2D05E00 at a point where the inferred type is observable (e.g. via overload resolution or a type-mismatch error), on both 32-bit and 64-bit targets.
Suggested fix (pending verification):
If confirmed, document the notation-dependent typing distinction; if not confirmed, no change needed.
Section: §1.7.1 Integer literal typing
Current text:
States integer literals are typed as the smallest of
Integer/Cardinal/Int64/UInt64that fits, uniformly across notations.Problem:
In practice, Delphi's literal typing may differ by notation: decimal literals that overflow
Integerare typedInt64(notCardinal), whereas hex/binary/octal literals of the same magnitude can be typedCardinalsince they're read as bit patterns rather than signed magnitudes. This nuance may be missing from the current uniform description.Why this needs compiler verification:
This project already verifies lexical claims via compiler fixtures (see
tests/Fixtures). Test the inferred type of a decimal literal like3000000000vs. the hex equivalent$B2D05E00at a point where the inferred type is observable (e.g. via overload resolution or a type-mismatch error), on both 32-bit and 64-bit targets.Suggested fix (pending verification):
If confirmed, document the notation-dependent typing distinction; if not confirmed, no change needed.