Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Parser rejects `private @attr {…}` and a doc comment before a non-record type

Offen
#9,106 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@cknitt arbeitet bereits daran.

Seit 28.10.2026.

  • #9115 von @cknitt — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
ocaml
Bereich
compilers

Rechercherichtung

Start in compiler/syntax/src/res_core.ml at parse_private_eq_or_repr and the type representation dispatch around the cited lines. Trace how private attributes and DocComment tokens reach parse_typ_expr or parse_type_representation, then check nearby parser tests for the corresponding syntax cases. Done means both examples and the listed related type forms parse without changing existing cases; pull request #9115 is already open.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Found by a bug hunt over the 16 commits from eb087382 to cd641cbc.

private followed by an attribute and a record.

type t = private @attr {x: int}

This fails with "An inline record type declaration is only allowed in a variant constructor's declaration or nested inside of a record type declaration". type t = @attr {x: int} (#8919) and type u = private {x: int} both parse. At counts as the start of a type expression (res_grammar.ml#L205), so parse_private_eq_or_repr parses @attr {x: int} with parse_typ_expr (res_core.ml#L5802-L5803). The non-private path has its own At lookahead (res_core.ml#L6043).

A doc comment after = in front of a non-record type.

type z = /** d */ int

This fails with "Did you mean Int instead of int?". {"a": int}, (int, int) and [#A] fail the same way. /** d */ {x: int}, /** d */ A | B and @attr int parse. res_core.ml#L6037 sends DocComment straight to parse_type_representation. The At case at the next arm looks ahead for objects and manifests first.

Both reproduce at b123b7c3.

🤖 Generated with Claude Code

Vorherrschende Sprache
OCaml
Sterne
7.5k
Forks
484
Ø Merge
20 Std. 19 Min.
Gemergte PRs (30 T.)
242

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

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 rescript-lang/rescript

Alle Issues in rescript-lang/rescript

Ähnliche Issues

Weitere Issues zu Compilers

Neue Issues direkt in Ihr Postfach

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