Repository navigation
Comparing changes
Open a pull request
base repository: HaxeFoundation/haxe
base: development
head repository: HaxeFoundation/haxe
compare: fix/call-arg-errors-patch1
- 13 commits
- 88 files changed
- 1 contributor
Commits on Jun 8, 2026
-
Configuration menu - View commit details
-
Copy full SHA for fe5d4d8 - Browse repository at this point
Copy the full SHA fe5d4d8View commit details -
[tests] add tests for diagnostics false positives with function args (#…
Configuration menu - View commit details
-
Copy full SHA for cf6e345 - Browse repository at this point
Copy the full SHA cf6e345View commit details -
[tests] add tests for call-argument / function-body error reporting
Documents several error-reporting issues when a call argument (often a function literal) fails to type. The .stderr files hold the expected (correct) output, so the still-broken cases are red until fixed and the fixed cases stay green. Failing (known issues, expected output is the tentative correct one): - Swallow: a real error that is a side effect of typing an argument (module load) is silently dropped when the argument is skipped to a later optional parameter. - Cascade*: a block-bodied function literal with an inner error reports the real error plus a spurious "Void should be Int" unification error (array/var/return variants reproduce on development; the call-argument variant on this branch). - MaskStruct*: when an argument is skipped past an earlier optional and then fails against the intended one, only the first (irrelevant) mismatch is reported, hiding the real "Object requires field y". Reproduces on development. Passing (guard behavior fixed on this branch): - MaskBody*: a non-return unification error inside the body, fully masked on development, is now reported with the real "String should be Int". - DuplicateReport: an error reported twice on development (skip + re-type) is now reported once. See #5837, #10634.
Configuration menu - View commit details
-
Copy full SHA for 19810bd - Browse repository at this point
Copy the full SHA 19810bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 93d17c3 - Browse repository at this point
Copy the full SHA 93d17c3View commit details -
[typer] report function-body / call-argument errors at their own posi…
…tion (#10634, #7924) When typing a call argument, errors that occur inside the body of a function literal were attributed to the enclosing call argument ("For function argument 'x'"), and in diagnostics mode an unresolved identifier produced a false positive instead of letting optional-argument skipping / overload resolution recover. Four related changes fix this: - type_local_function resets in_call_args while typing the body, so body errors are reported in place instead of being re-raised and wrapped by arg_error (kept during overload resolution, where a body error must reject the candidate). - type_block recovers a failed value-position expression as a fresh monomorph instead of dropping it to Void, avoiding a spurious cascade ("Void should be Int") against the expected type. - type_ident raises for an unresolved identifier while in_call_args even in diagnostics mode, so the skip / overload machinery can recover (no false positive). - unify_call_args rolls back the function-literal body errors of an argument that is skipped to a later parameter (re-emitted when it binds), so they are not reported twice, while preserving once-only side-effect errors (e.g. module load).
Configuration menu - View commit details
-
Copy full SHA for a81eb53 - Browse repository at this point
Copy the full SHA a81eb53View commit details -
[typer] recover expression-body errors in function-literal call argum…
…ents (#12934) A block-bodied function literal recovers body errors per-statement inside type_block, but an expression body (e.g. `() -> x` / `function() x`) let the error propagate out of type_function. When the function literal is a call argument, that propagated error was caught as a signature failure, which then reported a stale skipped-argument error and masked the real one: foo(0, TInt, function() x) // wrongly: "Unknown identifier : TInt" for ?v Now a call-argument function literal recovers its body error in place (committed while in_call_args is reset), so the argument binds normally and the real error is reported at its own position (here the unresolved `x`), letting `TInt` resolve against the later Type.ValueType parameter.
Configuration menu - View commit details
-
Copy full SHA for 659f86d - Browse repository at this point
Copy the full SHA 659f86dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92a1f71 - Browse repository at this point
Copy the full SHA 92a1f71View commit details -
[typer] harden call-arg body-message tracking; add multi/nested funct…
…ion-literal tests Record the rollback set as the message prefix newer than messages_before, bailing out if that boundary is no longer a tail (a nested call may have rolled messages back via List.filter) so we never roll back unrelated messages. Tests cover multiple function-literal arguments and a nested skipping call: - MultiBind: two function-literal args, both bodies error -> both reported in place. - NestedSkip: a function-literal body containing a skipping call whose argument body errors -> each error reported once, in place. - MultiNoSkip: no skip room, the first function literal cannot fit ?n:Int.
Configuration menu - View commit details
-
Copy full SHA for a77e577 - Browse repository at this point
Copy the full SHA a77e577View commit details -
[typer] suppress impossible function-vs-non-function signature error …
…after a body error When a function literal whose body already reported error(s) in place is passed to a non-function parameter (e.g. `() -> err` against `?n:Int`), it can never fit, so the trailing signature mismatch is pure noise. Suppress it and recover (default the parameter) so later arguments are still checked. A function-vs-function mismatch is a real signature error and is kept (see SignatureKept). Updates MultiNoSkip (now reports both body errors) and adds SignatureKept.
Configuration menu - View commit details
-
Copy full SHA for 5ead789 - Browse repository at this point
Copy the full SHA 5ead789View commit details
Commits on Jun 9, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 8c47d3c - Browse repository at this point
Copy the full SHA 8c47d3cView commit details -
[typer] group call-arg resolution state into call_arg_context
Replace g.call_arg_body_messages and f.in_overload_call_args with a single g.call_arg_context option, Some only while unify_call_args resolves a call. Both moved fields share that exact lifetime, so the manual save/restore and cross-file raw mutation collapse into enter_call_args plus a few accessors. in_call_args stays a separate bool: it is additionally toggled off while typing function-literal bodies and display sub-expressions, a finer lifetime than the call_arg_context. delayed_display is left untouched.
Configuration menu - View commit details
-
Copy full SHA for d4c6f74 - Browse repository at this point
Copy the full SHA d4c6f74View commit details -
Configuration menu - View commit details
-
Copy full SHA for 214cf82 - Browse repository at this point
Copy the full SHA 214cf82View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d0e888 - Browse repository at this point
Copy the full SHA 1d0e888View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff development...fix/call-arg-errors-patch1
