SMALLINT was collapsed onto INTEGER in three places, each producing an int?
where a short? was needed:
- the cast fallback switch fell DTYPE_SMINT through into DTYPE_INT
- explicitCastFunction returned "AsInt" for DTYPE_SMINT
- the CALL ... RETURNING path folded SMALLINT onto INTEGER before deciding
whether a mapping variable was needed, so a SMALLINT-against-INTEGER return
was judged to match. C# passes those by out, which admits no conversion at
all, so the call would not compile without the mapping variable this
decision creates.
INTERVAL qualifiers are now built rather than spelled out. The leading field's
precision was being folded into the unit name - INTERVAL YEAR(4) TO MONTH
emitted FglTimeUnit.Year4, which no enum has - and elsewhere the qualifier was
passed as a string for the runtime to parse back, with the precision dropped on
the way. Both now emit a constructed FglIntervalQualifier carrying the two
fields and the precision, which the compiler can check and nothing has to
re-read at run time. Precision matters: it decides the width DISPLAY gives the
value. EXTEND is emitted the same way, as two units rather than a string.
LOAD and UNLOAD were A4GL_assertion(1, "Not implemented yet"), so any module
using them failed outright. Both are now emitted, UNLOAD handling a statement
held in a string and a parsed query - the latter going through the same
preprocessing and variable substitution a SELECT does so its variables become
bindings.
Also here:
- find_function fell through its cases, re-comparing a non-matching function
definition through report_definition.funcname - the wrong arm of the union
- a static Main is emitted for the module holding the 4GL MAIN, calling
FglModule.Run<T> so startup policy lives in the runtime
- Year, Month, Day, the UNITS builtins and Pow were emitted unqualified and
resolved against nothing
- a comparison with a DATE or DATETIME on one side only now goes through the
comparison helper: 4GL stores a DATE as a day count and lets it be compared
with an integer, which a raw C# == cannot do
- a call with fewer arguments than the prototype declares is padded, so the
existing FGLCHECK marker is left on a call that still compiles rather than
on one that cannot
- a bounded loop where ensure_parameters walked the declared parameter count
while indexing the arguments actually present, which ran off the end