Reading a field of a class declared later in the file loses its refinement
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- compilers, testing-qa
Línea de trabajo
Start with RefinementTypeChecker.visitCtField and visitCtFieldRead, which the issue identifies as the source-order context handling path. Use the supplied ReadBefore reproducer to confirm the false “not enough information” error, then compare it with the version where Job is declared earlier. Done means the reproducer reports “Correct! Passed Verification.” and reads still work when the class is declared later.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Reading a field of an object whose class is declared later in the file does not pick up the field's refinement, so a correct program fails with a false "not enough information" error. Writes to such fields are handled by #314 (fixing #308); reads are not.
Minimal reproducer
import liquidjava.specification.Refinement;
public class ReadBefore {
private final Job job = new Job();
@Refinement("_ >= 0")
public int get() { return job.port; }
static class Job { @Refinement("_ >= 0") int port; }
}
Expected
Correct! Passed Verification.
Actual
Refinement Error: true is not a subtype of #ret² >= 0
5 | public int get() { return job.port; }
| ^^^^^^^^^^^^^^^^
--> Not enough information to prove the expected refinement. Add a refinement or condition to constrain it.
Moving Job above get makes it pass.
Cause
Fields enter the context only in the second pass (RefinementTypeChecker.visitCtField), in source order. When job.port is read, this#port is not in context yet, so visitCtFieldRead falls through to new Predicate() (no information).
Reproduced on main at fbfb4e23 (liquidjava-verifier 0.0.35), and on the #314 branch.
- Lenguaje dominante
- Java
- Estrellas
- 67
- Forks
- 36
- Merge medio
- 4 d 17 h
- PR fusionados (30 d)
- 7
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de liquid-java/liquidjava
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
liquid-java/liquidjava#321 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
liquid-java/liquidjava#323 ·
Los mantenedores suelen responder en 2 días
-
Soundness: a field of another class or object is read as this class's field with the same nameAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
liquid-java/liquidjava#322 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
liquid-java/liquidjava#318 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
liquid-java/liquidjava#317 ·
Los mantenedores suelen responder en 2 días
Todos los issues de liquid-java/liquidjava
Issues similares
-
Update license yearAbierto0 - Backlog 1 - Ready documentation good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
cbor
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
FasterXML/jackson-dataformats-binary#844 ·
Los mantenedores suelen responder en 1 día
-
improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/iceberg#18351 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
repowise-dev/repowise#2945 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Interpolating settings.xml can lead to malformed XML when variable value contains double-hyphenAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/maven#13321 · 1 comentario ·
Los mantenedores suelen responder en 1 día