onyx-lang / onyx

✨ The compiler and developer toolchain for Onyx

Home Page:https://onyxlang.io

Repository from Github https://github.comonyx-lang/onyxRepository from Github https://github.comonyx-lang/onyx

Bug: declaring and instantiating multiple typed variables

josdelien opened this issue · comments

Consider the following code:

use core {*}

main :: () {
    println(fib(10));
}

fib :: (seqlen: u32) -> [..]u32 {
    seq: [..]u32;
    temp: u32;
    // -a- this works
    // a, b: u32;
    // a, b = 0, 1;
    // 
    // -b- this also works
    // a, b := 0, 1;
    //
    // -c- this yields compile error
    a, b :u32 = 0, 1;
    while seq.length < seqlen {
        array.push(&seq,a);
        temp = a;
        a = b;
        b = a+b;
    }
    return seq;
}

The error yielded is:

expected token ';', got '='.
 18 |     a, b :u32 = 0, 1;
                    ^