[Bug] List type parameters silently accept non-type expressions
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- tooling
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 272
- Forks
- 55
- Ø Merge
- 12 Std. 18 Min.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus salesforce/agentscript
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
salesforce/agentscript#103 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
salesforce/agentscript#102 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
salesforce/agentscript#101 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 61/100
salesforce/agentscript#85 ·
Maintainer antworten meist innerhalb von 1 Tag
-
README Quick Start fails on macOS: Node 26 incompatibility and missing tree-sitter CLI prerequisiteEvtl. wieder frei @dsorajisto hat das vor 168 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 75/100
salesforce/agentscript#33 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in salesforce/agentscript
Ähnliche Issues
-
Plugin: sheet music can't be scrolled by hand before playbackEvtl. vergeben @snakajima hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
receptron/jinglescript#51 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 9 Tagen
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
openclaw/openclaw#186424 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
chore(worker): five module header comments describe the code from before later issues changed itOffenarea:dev U2-later
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
bentleypark/aiwatch#1824 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Pal-AI-Lab/Coopanion#469 ·
Maintainer antworten meist innerhalb von 1 Tag