odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.61k stars 577 forks source link

Comma between params isnt needed for two param proc #4278

Open FourteenBrush opened 3 days ago

FourteenBrush commented 3 days ago

Context

The following code compiles and runs just fine, despite a missing comma between the parameters, note that this is only reproducible with two parameters:

package bug

import "core:fmt"

main :: proc() {
    something(1, 2)
}

something :: proc(x: int y: int) {
    fmt.println("works fine")
}

Expected Behavior

Compiler error stating missing comma

Steps to Reproduce

odin run file.odin -file

Kelimion commented 3 days ago

Confirmed. x and y were even assigned the correct values.

package bug

import "core:fmt"

main :: proc() {
    something(1, 2)
}

something :: proc(x: int y: int) {
    fmt.printfln("works fine: x={} y={}", x, y)
}