Parser rejects `private @attr {…}` and a doc comment before a non-record type
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- ocaml
- Ambito
- compilers
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 484
- Merge medio
- 20h 19m
- PR unite (30g)
- 242
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rescript-lang/rescript
-
Record coercion can construct a private record from outside its moduleForse già presa @cknitt l’ha presa oggi. Aperta
Difficoltà 4/5 1-2 giorni Idoneità per principianti 52/100
rescript-lang/rescript#9124 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
rescript-lang/rescript#9123 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 55/100
rescript-lang/rescript#9122 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
rescript-lang/rescript#9109 ·
I maintainer di solito rispondono entro 1 giorno
-
Formatter: five cases where comments and doc comments are placed wronglyForse già presa @cknitt l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rescript-lang/rescript#9107 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rescript-lang/rescript
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CanadaHonk/porffor#426 ·
-
[MLIR][TOSA] Assertion in verifyBlockScaledTensorType when a tosa op result type is not a tensorApertacrash mlir:tosa
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
llvm/llvm-project#236561 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
A-lexer
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
oxc-project/oxc#28320 ·
I maintainer di solito rispondono entro 1 giorno
-
[python] Python library model: str(None) is modelled as an unconstrained string instead of "None"Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
area:codegen backend:spirv bug direction:input
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno