Skip to content

Compiler can't recognize the absence of a parameter. #2959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kcvinker opened this issue Nov 15, 2023 · 0 comments
Open

Compiler can't recognize the absence of a parameter. #2959

kcvinker opened this issue Nov 15, 2023 · 0 comments
Labels

Comments

@kcvinker
Copy link

I found an interesting bug. When we use typed varargs, assume that there is a parameter with same type and if we missed that, compiler can't recognize it. It will show an error message like this
D:\a\Odin\Odin\src\check_expr.cpp(5543): Assertion Failure: 'variadic_operands.count != 0'

Context:
OS : Windows 11 x64
Odin version : dev-2023-11-nightly:ef5eb4b6

Here is the sample code to reproduce the error.

package main
import "core:fmt"

sample_proc :: proc(x: bool, y: string, items: ..string)
{
    for item in items
    {
        fmt.println(item)
    }
}

proc2 :: proc(x: int, va: ..string)
{
    sample_proc(false, ..va) // Intentionally avoid second parameter.
}


main :: proc()
{

}
@github-actions github-actions bot added the stale label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant