Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Formatter prints @res.doc on a function parameter as a doc comment that does not parse

Abierto
#8,994 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ocaml
Área
compilers

Línea de trabajo

Start by tracing bsc -format from the formatter path that prints @res.doc on function parameters; compare it with how @ocaml.doc and @ns.doc are preserved, and inspect the parser around parameter doc comments. The issue permits either keeping the attribute form in formatter output or accepting the comment in the parser. Done means the shown input formats to output that parses successfully when formatted again.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The formatter prints a @res.doc attribute on a function parameter as a doc comment in front of the parameter, and the parser rejects that output.

let f = (@res.doc("The runner") run: string) => run

bsc -format prints:

let f = (
  /**The runner*/
  run: string,
) => run

Formatting that output again fails:

  Syntax error!
  2 │   /**The runner*/
  3 │   run: string,

  I'm not sure what to parse here when looking at "DocComment The runner".

So formatting turns a file that compiles into one that doesn't. @ocaml.doc/@ns.doc on a parameter have been formatted unchanged, because the printer prints only res.doc as a doc comment. If #8992 lands, @res.doc is the only doc attribute left, so writing it by hand on a parameter hits this. genType's tests/gentype_tests/typescript-react-example/src/Comments.res keeps @ocaml.doc on two parameters for this reason.

Either the printer keeps the attribute form for parameters, or the parser accepts a doc comment before a parameter.

Found while working on #8978.

🤖 Generated with Claude Code

Lenguaje dominante
OCaml
Estrellas
7.5k
Forks
483
Merge medio
21 h 8 min
PR fusionados (30 d)
183

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rescript-lang/rescript

Todos los issues de rescript-lang/rescript

Issues similares

Más issues de Compilers

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.