Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Create interface drops attributes in front of type declarations

Fechada
#9,095 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Um pull request relacionado já foi integrado.

  • #9096 de @cknitt — integrado

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
58/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
ocaml

Direção de pesquisa

Start at the editor's "Create interface file" command and trace how it copies type declarations into the generated .resi. Check how source locations handle attributes before type, then compare the generated signature with the implementation for the @tag example. Done means the generated interface preserves representation attributes such as @tag and passes the signature check.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Create interface (the editor's "Create interface file" command) drops attributes written in front of a type declaration:

@tag("kind") type tagged = A(int)

gives

             type tagged = A(int)

The type declaration is copied from the source starting at its location, which begins at type, after the attributes in front of it, so they are replaced by spaces. For @tag (and likewise @unboxed and other representation attributes) the generated .resi then no longer matches the implementation, because the signature check compares the variant's tag name.

This happens without any functor involved, also on master. Found while reviewing #9077, part of #9074.

Linguagem predominante
OCaml
Estrelas
7.5k
Forks
484
Merge médio
21h 9min
PRs com merge (30d)
255

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de rescript-lang/rescript

Todas as issues de rescript-lang/rescript

Issues semelhantes

Mais issues de DevTools

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.