DanielGavin / ols

Language server for Odin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong type when multi assign with arrays

blob1807 opened this issue · comments

It's seeing yd as a bool it should be int. The type doesn't matter it'll always been seen as bool.

Foo :: struct{d: []int}
x,y := Foo{d=[]int{1,2,3}}, Foo{d=[]int{1,2,3}}

for _, i in x.d {
    xd, yd := x.d[i], y.d[i]
    fmt.println(xd, yd)
}

OLS: VS Code v0.1.26
IDE: VSCodium
OS: Windows

Forgot to add. It will see td as int if you explicitly use the type.

Foo :: struct{d: []int}
x, y := Foo{d=[]int{1,2,3}}, Foo{d=[]int{1,2,3}}

for _, i in x.d {
    xd, yd: int = x.d[i], y.d[i]
    fmt.println(xd, yd)
}