Skip to content

fix(language): reject non-type list parameters - #92

Open
BichengWang wants to merge 1 commit into
salesforce:mainfrom
BichengWang:BichengWang/contribution-script-language-all-20261009
Open

BichengWang wants to merge 1 commit into
salesforce:mainfrom
BichengWang:BichengWang/contribution-script-language-all-20261009

Conversation

@BichengWang

@BichengWang BichengWang commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Reject literals and other expressions used as a list declaration's element type. For example, items: mutable list[1] now reports invalid-type-parameter at 1 instead 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

  • My code follows the project's coding style
  • I have reviewed my own diff
  • I have added/updated documentation as needed (no documentation change needed: accepted type syntax is unchanged)
  • This change does not introduce new warnings

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] List type parameters silently accept non-type expressions

1 participant