Report `#[contracterror]` on a non-enum item

Offen
#40 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
javascript
Bereich
tooling

Rechercherichtung

Start with src/parse.js and src/analyze.js to trace how #[contracterror] attributes and item kinds are handled, then read the related cases in test/parse.test.js and test/analyze.test.js. Add an error finding for the attribute on a non-enum item, including its kind and line, and document the rule in docs/RULES.md. Run npm test -- test/analyze.test.js and confirm attributed enums remain unaffected.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

analysis wave

Context

The attribute only makes sense on an enum. When it is placed on a struct or union, the parser skips it and the mistake is silent.

Scope

  • src/parse.js
  • src/analyze.js
  • test/parse.test.js
  • test/analyze.test.js

Acceptance criteria

  • A new attribute-misplaced finding names the item kind and the line.
  • The finding is an error.
  • An enum with the attribute is unaffected.
  • The rule is documented in docs/RULES.md.

Verification

npm test -- test/analyze.test.js

Complexity

Medium (3 hours)

Part of Stellar Wave. Comment to claim this issue before starting.

Vorherrschende Sprache
JavaScript
Sterne
0
Forks
2
Ø Merge
1 T. 1 Std.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus codepacct/codepact-core

Alle Issues in codepacct/codepact-core

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.