Soundness: an error in an enum or record static initializer hides errors in later types
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
- 62/100
Direção de pesquisa
Start with visitCtRecord and visitCtEnum in RefinementTypeChecker, and compare them with the per-member catches in visitCtMethod and visitCtConstructor. Reproduce with the two files in demo/ from the issue: the enum static initializer error currently stops the check before Z.m. Done means both the Z.use(-1) error in Mode and the n = -1 error in Z.m are reported, for enums, records and the class field and initializer cases.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Impact: violations are silently not reported (the verdict is still a failure, but only for the first error). Found while investigating #342.
Description
An error raised in a static initializer of an enum or record stops checking of every later type in the package. visitCtRecord and visitCtEnum in RefinementTypeChecker have no per-member catch, so the error reaches RefinementProcessor.processPackage. With a class the same code reports both errors. Also, for classes, an error in a field initializer or initializer block reaches the catch in visitCtClass, and the rest of that class is not checked.
Minimal reproducer (both files in one directory demo/)
package demo;
enum Mode {
A;
static { Z.use(-1); }
}
package demo;
import liquidjava.specification.Refinement;
class Z {
static void use(@Refinement("_ > 0") int x) {}
void m() {
@Refinement("_ > 0") int n = -1;
}
}
Expected
Two Refinement Errors: Z.use(-1) in Mode, and n = -1 in Z.m.
Actual (main ad055b49)
Only the first one. Same with record Mode(int a) { static { Z.use(-1); } }. With class Mode { static { Z.use(-1); } } both errors are reported.
Possible fix
Per-member catches like the ones in visitCtMethod / visitCtConstructor, for initializers and field initializers of classes, enums and records.
- Linguagem predominante
- Java
- Estrelas
- 73
- Forks
- 38
- Merge médio
- 12h 32min
- PRs com merge (30d)
- 45
Preparar o ambiente
- 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 liquid-java/liquidjava
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
liquid-java/liquidjava#562 ·
Mantenedores costumam responder em até 1 dia
-
A float ghost crashes the verifier: "Ghost not implemented for type float"Talvez já em andamento @MohammedZaid1740 assumiu há 7 dias. Abertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
liquid-java/liquidjava#443 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug real-world-finding
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
liquid-java/liquidjava#395 ·
Mantenedores costumam responder em até 1 dia
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatibleTalvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 15/100
liquid-java/liquidjava#558 ·
Mantenedores costumam responder em até 1 dia
-
new T[a][b] gets length b instead of a (unsound)Talvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 30/100
liquid-java/liquidjava#557 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de liquid-java/liquidjava
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 60/100
quelea-projection/Quelea#749 ·
Mantenedores costumam responder em até 1 dia
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
erkamyaman/rust-anything#963 ·
Mantenedores costumam responder em até 1 dia
-
api-diagnostics bug jdbc
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
ClickHouse/clickhouse-java#3464 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 76/100
-
Deferred
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Sanne/incus-spawn#2768 ·
Mantenedores costumam responder em até 1 dia