Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Verifier crashes on a call to a varargs method with two or more arguments

未關閉
#349 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
java
領域
compilers

研究方向

Start by running the minimal reproducer in main and trace how the verifier checks the count("a", "b") invocation against the varargs method. The issue does not name a source file or test, so locate the invocation-checking code and its existing tests. Done means the reproducer prints Correct! Passed Verification. instead of crashing.

由索引模型根據 Issue 內容生成。

描述

bug

Impact: verification stops with an internal error. Found while building a test fixture; no example blocked yet.

Description

Calling a user-defined varargs method with two or more arguments crashes (Index 1 out of bounds for length 1): the arguments are matched one-to-one with the single array parameter.

Minimal reproducer

public class Repro {
    static int count(String... names) {
        return names.length;
    }

    public static void main(String[] args) {
        int n = count("a", "b");
        System.out.println(n);
    }
}

Expected

Correct! Passed Verification.

Actual

Exception in thread "main" java.lang.RuntimeException: 
Error while checking CtMethodImpl
  on main(String[] args) { 
  with 
Error while checking CtBlockImpl
  on { 
  with 
Error while checking CtLocalVariableImpl
  on n = count("a", "b"); 
  with 
Error while checking CtInvocationImpl
  on count("a", "b"); 
  with Index 1 out of bounds for length 1
Caused by: java.lang.RuntimeException: 

Reproduced on main at 0472025e (liquidjava-verifier 0.0.35); also on fbfb4e23 and 0.0.33 in the original form.

Context

Found while turning bugs mined from real open-source Java (fixed upstream or still present) into study examples for the error-message study.

主要語言
Java
星號
67
分支
36
平均合併
2 天 3 小時
30 天內合併 PR
29

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

liquid-java/liquidjava 的其他 Issue

查看 liquid-java/liquidjava 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。