[Bug] List type parameters silently accept non-type expressions
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 55/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- tooling
Direção de pesquisa
Start in the TypedMapParser.validateSubscriptType function, which currently handles only identifier and nested-subscript arguments, and see how it dispatches on argument shape. Add an Error diagnostic of kind invalid-type-parameter for literal, reference and expression arguments inside list brackets, pointing at the argument. Done when the five declarations in the reproduction yield Error diagnostics and the real-schema regression tests pass, while supported primitives and the unknown-type and nested-list-type controls still behave as before.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
List declarations accept literals and other expressions as their element type without an error. The documented list syntax requires a supported type, such as list[string], but TypedMapParser.validateSubscriptType only handles identifier and nested-subscript arguments. Other argument shapes fall through validation.
Steps to Reproduce
- Use the source checkout at
16396089a4264b544d40d4aaf83c1f8aa981760cwith the standard AgentScript schema and default lint rules. - Parse each declaration in the reproduction below.
- Inspect the parse and lint diagnostics.
Expected Behavior
Each non-type argument produces an Error diagnostic pointing to the argument inside the brackets. Supported primitive identifiers remain accepted.
Actual Behavior
All five declarations parse without syntax errors and receive no type Error. The default lint engine reports only an unused-variable warning for an isolated declaration. Controls correctly reject list[missing] as unknown-type and list[list[string]] as nested-list-type.
Environment
- Node.js: 22.20.0
- pnpm: 10.28.0
- OS: macOS 27.0.1, arm64
- Package: source build of
@agentscript/language3.2.3 and@agentscript/agentscript-dialect3.4.0
Minimal Reproduction
variables:
number_parameter: mutable list[1]
boolean_parameter: mutable list[True]
string_parameter: mutable list["string"]
reference_parameter: mutable list[@variables.other]
expression_parameter: mutable list[string + number]
Additional Context
Real-schema regression tests for these five forms fail against unchanged code because the Error diagnostic array is empty. All 12 supported element types and the two negative controls pass in the same run: 5 failed, 14 passed. The change can reuse invalid-type-parameter for the previously unhandled argument shapes.
- Linguagem predominante
- TypeScript
- Estrelas
- 274
- Forks
- 56
- Merge médio
- 12h 18min
- PRs com merge (30d)
- 5
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de salesforce/agentscript
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
salesforce/agentscript#103 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
salesforce/agentscript#102 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
salesforce/agentscript#101 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 61/100
salesforce/agentscript#85 ·
Mantenedores costumam responder em até 1 dia
-
README Quick Start fails on macOS: Node 26 incompatibility and missing tree-sitter CLI prerequisiteTalvez livre de novo @dsorajisto assumiu há 174 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 Meio dia Facilidade para iniciantes 75/100
salesforce/agentscript#33 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de salesforce/agentscript
Issues semelhantes
-
ci-cd desktop size:low telemetry-improvement telemetry-round-1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
vfarcic/dot-agent-deck#2079 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Broken links in the docsAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia
-
status:in-linear
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
n8n-io/n8n#43006 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
🔊 a11y
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
betagouv/mon-entreprise#4726 ·
Mantenedores costumam responder em até 9 dias