Repository navigation
fix(language): reject non-type list parameters - #92
Open
BichengWang wants to merge 1 commit into
Open
BichengWang wants to merge 1 commit into
BichengWang wants to merge 1 commit into
Conversation
This branch has not been 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.
What
Reject literals and other expressions used as a list declaration's element type. For example,
items: mutable list[1]now reportsinvalid-type-parameterat1instead of passing type validation.Why
Fixes #91. List element parameters must be supported type identifiers; the validator previously ignored argument shapes other than identifiers and nested subscripts.
How
Add an Error diagnostic for the remaining argument shapes, using the argument's source range and the existing diagnostic code. Real-schema tests cover the five reproduced forms, all 12 supported element types, existing unknown/nested-type errors, and precise diagnostic ranges.
Test Plan
New regression file against unchanged code: 5 failed, 14 passed; fixed code: 19 passed.
pnpm test --force: all 24 Turbo tasks passed, zero cached tasks; language 324 passed, AgentScript dialect 1499 passed.pnpm lint --force: passed with 12 existing warnings in unchanged UI files; changed-file ESLint passed without warnings.pnpm typecheck --force: all 24 Turbo tasks passed, zero cached tasks, including the language and dialect package checks.pnpm format:check: passed.Existing skips: AgentScript dialect 940, LSP 7, compiler 3. The initial sandbox test run could not bind compile-server test ports; the complete rerun with local port access passed, including all 27 compile-server tests.
Existing tests pass (
pnpm test)New/updated tests cover the change
Linting and type checks pass (
pnpm lint && pnpm typecheck)Checklist