Skip to content

Aligning implementation/specification error codes - phase 3/5 - #1989

Merged
Roman-Manevich merged 7 commits into
masterfrom
asl-error-codes-phase-3
Sep 8, 2026
Merged

Roman-Manevich merged 7 commits into
masterfrom
asl-error-codes-phase-3

Conversation

@Roman-Manevich

Copy link
Copy Markdown
Collaborator

Distinguish lexical and parse failures

Lexer-detected invalid symbols now use UnknownSymbol and report BE_LE, preserving suggested replacements, while the remaining CannotParse errors report BE_PE.

Classify global-initialization exceptions

Exceptions escaping global initialization now report DE_UE, and build_genv in asl.spec converts the corresponding throwing result to DynamicError(DE_UE).

Classify asserted-type-conversion failures

Failed asserted type conversions now use ATCFailure, reporting DE_TAF during dynamic evaluation and TE_SEF during static evaluation as specified by asl.spec.

Classify repeated tuple-field writes

Repeated fields in tuple assignments now report TE_IAD, matching the specification's use of check_no_duplicates rather than the rework PR's disputed BE_PE mapping.

Distinguish call and tuple arity failures

Static call arity failures now report TE_BC through BadCallArity, while tuple arity failures report TE_UT through BadTupleArity; unchecked runtime arity failures remain uncoded.

@Roman-Manevich Roman-Manevich changed the title Aligning implementation/specification error codes - phase 2 Aligning implementation/specification error codes - phase 3 Sep 4, 2026
@Roman-Manevich
Roman-Manevich marked this pull request as ready for review September 4, 2026 11:42
@Roman-Manevich
Roman-Manevich changed the base branch from master to asl-error-codes-phase-2 September 4, 2026 11:42
@Roman-Manevich
Roman-Manevich force-pushed the asl-error-codes-phase-3 branch 2 times, most recently from 71be2cd to 79d0133 Compare September 4, 2026 14:14
Comment thread asllib/Lexer.mll Outdated
Comment thread asllib/error.ml Outdated
Comment thread asllib/error.ml
Comment thread asllib/error.ml
Comment thread asllib/error.ml Outdated
Comment thread asllib/error.ml Outdated
Comment thread asllib/error.ml Outdated
Comment thread asllib/Typing.ml
Comment thread asllib/error.ml Outdated
Comment thread asllib/error.ml Outdated
Comment thread asllib/Interpreter.ml Outdated
else
fatal_from e1 env (Error.MismatchType (B.debug_value v, [ t.desc ])))
fatal_from e1 env
(Error.ATCFailure (C.error_handling_time, B.debug_value v, t.desc)))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have something a bit more flexible than debug_value, ideally a formatter

Probably not for this PR.

Comment thread asllib/error.ml
Comment thread asllib/tests/lexer.t
Base automatically changed from asl-error-codes-phase-2 to master September 7, 2026 09:12
@Roman-Manevich
Roman-Manevich force-pushed the asl-error-codes-phase-3 branch from 0077e04 to 3ca79fc Compare September 7, 2026 09:12

@HadrienRenaud HadrienRenaud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me, but please double check with Hrutvik that he's happy with it

Comment thread asllib/error.ml Outdated
Comment thread asllib/error.ml Outdated

@hrutvik hrutvik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just a few minor bits to clear up before merging:

  • Hadrien's comment on provided vs. actual
  • Hadrien's comment on BadArity docstring

And then we can continue offline discussion on BadArity

Comment thread asllib/Typing.ml
Comment thread asllib/error.ml Outdated
@Roman-Manevich
Roman-Manevich force-pushed the asl-error-codes-phase-3 branch from 3c1daa3 to 4d5127a Compare September 8, 2026 15:30
@Roman-Manevich
Roman-Manevich merged commit 5b5976d into master Sep 8, 2026
6 checks passed
@Roman-Manevich Roman-Manevich changed the title Aligning implementation/specification error codes - phase 3 Aligning implementation/specification error codes - phase 3/5 Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants