Formatter prints @res.doc on a function parameter as a doc comment that does not parse
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- ocaml
- Domínio
- compilers
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- OCaml
- Estrelas
- 7.5k
- Forks
- 483
- Merge médio
- 19h 35min
- PRs com merge (30d)
- 208
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de rescript-lang/rescript
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
rescript-lang/rescript#9037 ·
Mantenedores costumam responder em até 1 dia
-
Per-constructor @unboxed is not compared across interfaces or coercionsTalvez já em andamento @cknitt assumiu hoje. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
rescript-lang/rescript#9038 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
rescript-lang/rescript#9006 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 70/100
rescript-lang/rescript#8997 ·
Mantenedores costumam responder em até 1 dia
-
@notUndefined in an interface is not checked against the implementationTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
rescript-lang/rescript#8964 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de rescript-lang/rescript
Issues semelhantes
-
area:codegen backend:cuda backend:hip bug direction:input
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
CrossGL/crosstl#3061 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
build
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
AOMediaCodec/SVT-AV1#2500 ·
-
SIGSEGV in symex on __builtin_constant_p of a void expressionTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug goto-symex
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia