A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatible
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 15/100
Direção de pesquisa
Start from the Tern reproducer in the issue, which uses a ternary over int[] branches checked against a length(a) == 1 refinement, and reproduce both the Sorts (Array Int Int) and Bool are incompatible error and the args not-found variant. The verifier code that handles conditional expressions is not named in the payload, so locate it by searching for the ternary handling. Work is already under way in linked pull request #561, so check that before starting. Done means the reproducer passes with each branch's facts holding under its condition.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
A conditional expression (c ? x : y) whose branches are arrays crashes the verifier when the result is checked against a length refinement.
Minimal reproducer
import liquidjava.specification.Refinement;
public class Tern {
static void one(@Refinement("length(a) == 1") int[] a) {}
static void pick(boolean b) {
int[] a = b ? new int[1] : new int[1];
one(a); // should pass
}
}
Result on main:
Error: Sorts (Array Int Int) and Bool are incompatible
If the condition mentions args (boolean b = args.length > 0; inside main), the same program instead fails with Not Found Error: Variable 'args' could not be found, which also only happens with the array ternary.
Expected
The program passes: both branches have length 1. A branch array's facts should hold for the result under that branch's condition. Found while reviewing #540.
- 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
-
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
-
Invariant inference: mark inferred facts in diagnostics, and a hint to state a loop invariantTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaenhancement error messages
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
liquid-java/liquidjava#554 ·
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 65/100
avaje/avaje-metrics#139 ·
-
documentation good first issue help wanted
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
-
Attachment upload accepts a file part with no file chosen and stores an empty comp_attachmentTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
eclipse-sw360/sw360#4849 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
exoego/keycloak-fuhito#888 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: Skip cross-field checkpointing validation rules when checkpointing is disabledTalvez já em andamento @hutiefang76 assumiu hoje. Abertaaccepted bug good first issue java
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Sekelenao/Flinkboot#473 · 1 comentário ·
Mantenedores costumam responder em até 1 dia