Parser rejects `private @attr {…}` and a doc comment before a non-record type
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- ocaml
- Domaine
- compilers
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- OCaml
- Étoiles
- 7.5k
- Forks
- 484
- Merge moyen
- 20 h 19 min
- PR mergées (30 j)
- 242
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de rescript-lang/rescript
-
Record coercion can construct a private record from outside its modulePeut-être pris @cknitt l’a pris aujourd’hui. Ouverte
Difficulté 4/5 1-2 jours Accessibilité débutants 52/100
rescript-lang/rescript#9124 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 56/100
rescript-lang/rescript#9123 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 1-2 jours Accessibilité débutants 55/100
rescript-lang/rescript#9122 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
rescript-lang/rescript#9109 ·
Les mainteneurs répondent en général sous 1 jour
-
Formatter: five cases where comments and doc comments are placed wronglyPeut-être pris @cknitt l’a pris il y a 1 jour. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
rescript-lang/rescript#9107 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de rescript-lang/rescript
Issues similaires
-
[MLIR][TOSA] Assertion in verifyBlockScaledTensorType when a tosa op result type is not a tensorOuvertecrash mlir:tosa
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
llvm/llvm-project#236561 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
A-lexer
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
oxc-project/oxc#28320 ·
Les mainteneurs répondent en général sous 1 jour
-
[python] Python library model: str(None) is modelled as an unconstrained string instead of "None"Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
area:codegen backend:spirv bug direction:input
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
log1p loses all precision for small |x| wherever the polyfill runs (LLVM backend, Metal, WGSL)Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour