False error: @StateSet on a nested class gives "Argument Mismatch Error: ... expected Inner, got Inner"
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start with TypeChecker.createStateGhost, then follow how GhostFunction and Utils handle the nested-class name Outer$Inner; Expression.throwArgumentMismatchError explains the reported type mismatch. Reproduce using the issue's Java example and compare with the top-level Inner case; done when the nested-class example verifies with “Correct! Passed Verification.”
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Impact: typestates on a nested class cannot be used: every state refinement of it fails with a self-contradictory message (expected Inner, got Inner) and no source location. The same class at top level verifies.
Minimal reproducer
import liquidjava.specification.StateRefinement;
import liquidjava.specification.StateSet;
public class Outer {
@StateSet({"fresh", "ready"})
static class Inner {
@StateRefinement(to = "ready(this)")
public Inner() {}
@StateRefinement(from = "ready(this)", to = "fresh(this)")
public void use() {}
}
static void ok() {
Inner i = new Inner();
i.use();
}
}
Expected: Correct! Passed Verification., as for the same Inner as a top-level class.
Actual (main @ 0053074e; this is the whole output, with no code snippet):
Argument Mismatch Error: Argument '#this_1' and its respective parameter of ghost 'Outer$Inner.state1' types are incompatible: expected Inner, got Inner
Cause. TypeChecker.createStateGhost gives the stateN ghost the parameter type type.getSimpleName() (Inner). GhostFunction swaps that for the prefix only when it equals Utils.getSimpleName(prefix), which splits on . only, so for Outer$Inner it is Outer$Inner and the swap does not happen. The parameter type stays an unresolved reference to Inner, which is neither equal to nor a supertype of Outer$Inner in Expression.throwArgumentMismatchError; both print as Inner. Related: the $ vs . naming of nested classes also breaks @Ghost on them (Z3 sort mismatch, #467).
🤖 Generated with Claude Code
- Lenguaje dominante
- Java
- Estrellas
- 71
- Forks
- 37
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 46
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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
liquid-java/liquidjava#443 ·
Los mantenedores suelen responder en 2 días
-
bug real-world-finding
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
liquid-java/liquidjava#395 ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
liquid-java/liquidjava#373 ·
Los mantenedores suelen responder en 2 días
-
bug error messages
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
liquid-java/liquidjava#471 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 69/100
liquid-java/liquidjava#470 ·
Los mantenedores suelen responder en 2 días
Todos los issues de liquid-java/liquidjava
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
LtByXsl throws NoSuchElementException when defect element has no text contentPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
objectionary/lints#1640 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
virtualcell/vcell#2193 ·
Los mantenedores suelen responder en 1 día