Skip to content

DotExpression on tuples literals reveal a problem

test case

unit temp;

struct S
{
    var i = 0;
    var j = 0;
}

function main(): s32
{
    return ((0,0):S).i;
}   

output

temp.sx:11:21: error, (0, 0) provides no scope to resolve i
temp.sx:11:21: error, cannot implicitly convert (0, 0).i of type <error> to type s32

notes

That shoud provide an error about the value category, given how "tuple to struct" is implemented for now. The LHS is not a lvalue.

Edited by Basile.B