Printed type declarations drop @tag, @notUndefined and runtime annotations
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- ocaml
- Domínio
- compilers
Direção de pesquisa
Start with Printtyp.tree_of_type_decl, which the issue identifies as the printer used by error messages, hover, and createInterface. Compare its handling of @unboxed and @immediate with @tag, @notUndefined, @typeOf, and @instanceOf; use the named expected-output files and the applied-functor example to check the affected paths. Done means printed declarations retain these annotations in diagnostics, hover, and generated interfaces. An open linked pull request already tracks the work.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Printed type declarations keep @unboxed and @immediate, but drop the other annotations of a declaration: @tag, @notUndefined and the runtime annotations (@typeOf, @instanceOf). @as on fields and constructors is kept. The printer is Printtyp.tree_of_type_decl, used by error messages, hover and createInterface.
Error messages. The declaration the message is about is printed without the annotation it names:
module M: {
@tag("kind") type v = Circle({r: float}) | Square({side: float})
} = {
@tag("type") type v = Circle({r: float}) | Square({side: float})
}
Type declarations do not match:
type v = Circle({r: float}) | Square({side: float})
is not included in
type v = Circle({r: float}) | Square({side: float})
...
Their @tag annotations differ.
The same happens with @notUndefined (tests/build_tests/super_errors/expected/not_undefined_functor_argument.res.expected, where the expected side prints as type t) and with @typeOf (runtime_annotation_interface_over_record.res.expected).
Generated interfaces. createInterface prints a type when it cannot copy its source, as for a type of an applied functor. The annotation is lost and the interface does not match its implementation:
module Make = (X: {type t}) => {
@tag("kind") type wrapped = Value({value: X.t}) | Empty({reason: string})
}
module Applied = Make({
type t = int
})
The generated interface has module Applied: { type wrapped = Value({value: int}) | Empty({reason: string}) }, and compiling it with the implementation fails:
In module Applied:
Type declarations do not match:
type wrapped = Applied.wrapped = Value({value: int}) | Empty({reason: string})
is not included in
type wrapped = Value({value: int}) | Empty({reason: string})
...
Their @tag annotations differ.
Hover prints types the same way, so it hides these annotations too.
- Linguagem predominante
- OCaml
- Estrelas
- 7.5k
- Forks
- 484
- Merge médio
- 21h 9min
- PRs com merge (30d)
- 255
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 74/100
rescript-lang/rescript#9135 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
rescript-lang/rescript#9132 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
rescript-lang/rescript#9130 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 1-2 dias Facilidade para iniciantes 55/100
rescript-lang/rescript#9122 ·
Mantenedores costumam responder em até 1 dia
-
Dev dependencies interactingTalvez já em andamento @CarlOlson assumiu há 2 dias. Aberta
Dificuldade 4/5 1-2 dias Facilidade para iniciantes 25/100
rescript-lang/rescript#9089 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de rescript-lang/rescript
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 4 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
CanadaHonk/porffor#426 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
compiler-rt:asan llvm:transforms
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
llvm/llvm-project#236682 ·
Mantenedores costumam responder em até 1 dia