Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

A float ghost crashes the verifier: "Ghost not implemented for type float"

未关闭 适合新手
#443 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
testing-qa

调研方向

从 TypeChecker.java 中 Ghost 的默认处理开始,这里会抛出所报告的异常;然后比较 int 和 boolean ghost 如何获取默认值。使用提供的复现程序检查 float 情况;当 float ghost 获取到默认值,或 @Ghost 注解报告清晰的错误并列出支持的类型时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Declaring a float ghost crashes the verifier when the ghost needs its default value. The result should be either support for the type or a proper error at the @Ghost annotation.

Reproducer:

import liquidjava.specification.Ghost;
import liquidjava.specification.StateRefinement;

@Ghost("float level")
class Tank {
    @StateRefinement(to = "true")
    public void fill() {}
}

public class Main {
    public static void main(String[] args) { Tank t = new Tank(); t.fill(); }
}

Found on main @ f7f366c (also on 1a506fe):

Exception in thread "main" java.lang.RuntimeException:
Error while checking CtConstructorImpl
  on null
  at (no source position: CtConstructorImpl)
  with Ghost not implemented for type float
	at liquidjava.processor.refinement_checker.TypeChecker.scan(TypeChecker.java:99)
	...

int and boolean ghosts get defaults (0, false); double was not tried. Expected: a default for float too (or a user-facing error naming the supported ghost types).

Found while cataloguing spec forms for co-specification (probe V19 there). Low priority.

主要语言
Java
星标
71
派生
37
平均合并
1 天 19 小时
30 天内合并 PR
57

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

liquid-java/liquidjava 的其他 Issue

查看 liquid-java/liquidjava 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。