Repository navigation
Inference: widen keyword literals in lambda bodies; clearer descriptor diagnostics - #110
Merged
Merged
Conversation
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Confirmed all three reports on
origin/mainatfb1bb66; none was already fixed.:done. Widen literals to their primitive type in those two inference paths. This fixesfilter,map, nested lambdas, explicitget, and polymorphic membership calls without special-casing equality. Direct keyword bindings and branches retain their exact types; explicit singleton and enum parameter checks remain restrictive.:checkfunctions: function record patterns use the language's strict matcher, which rejects missing keys with a generic pattern failure. Preserve that existing language-wide behavior and implement the requested diagnostic alternative: resolve the check's record parameter and report its function, form, and undeclared holes. Other check evaluation failures also name their check and form. Document that declared optional holes are present asnil, while checks shared across forms with different holes can accept the whole record and useget. Regressions cover named functions, closures, aliases, anonymous checks, multiple missing holes, optional holes, and strict patterns infn,define,let, andmatch.get, empty records, and unrelated field names. Reuse the existing descriptor-slot spelling heuristic. Numeric argument errors now name the argument and operator and point at the offending argument.Updated
docs/writing-a-form.mdand the language reference, and added an@formalang/tspatch changeset. Reviewed the stored type-error fixture change: only its expected span changes, from the entire numeric call to the invalid string argument. Existing editor and macro provenance assertions likewise expect the more precise argument span. No surface goldens were regenerated.Validation:
pnpm install --frozen-lockfile;pnpm check(including changeset status, all 1,190 package tests, 248 surface comparisons, and the docs/llms.txtbuild);pnpm test:site(runspnpm website:buildand passes all 9 Chromium tests against the assembled production Worker).Open workspace in Conductor