False error: a boolean query (_ == true --> open(this)) in a class fails at its return

Abierto
#509 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
54/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

Start by tracing how @Refinement is checked on a method body and how the return refinement's this reference is represented when the return statement is checked. Compare that path with the external spec case described for Scanner.hasNext(). Done means the ordinary class example compiles with the stated refinement while the existing external spec behavior still works.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Problem. A boolean query in an ordinary class, a method whose return refinement relates its result to the state of this, fails when its body is checked:

import liquidjava.specification.*;

@StateSet({"unlocked", "locked"})
public class QueryShorthand {
    @StateRefinement(to = "locked(this)")
    public QueryShorthand() {}

    @Refinement("_ == true --> unlocked(this)")
    public boolean isUnlocked() {
        return true;
    }
}
Argument Mismatch Error: Argument '#ret_1' and its respective parameter of ghost 'QueryShorthand.state1' types are incompatible: expected QueryShorthand, got boolean

The same refinement works on an external spec (_ == true --> hasMore(this) on Scanner.hasNext()), whose methods have no body. When the return is checked, the state's argument seems to become the returned value instead of this.

Found while writing tests for #502.

Lenguaje dominante
Java
Estrellas
73
Forks
38
Merge medio
12 h 32 min
PR fusionados (30 d)
45

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de liquid-java/liquidjava

Todos los issues de liquid-java/liquidjava

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.