You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it.only('allows member access of union with invalid', () => {
program.setFile('source/main.bs', `
sub test(channels)
channel = invalid
for each channel in channels
if channel.id = 123
print "ok"
end if
end for
end sub
`);
program.validate();
expectZeroDiagnostics(program);
});
Here's a test that fails with the issue. Mine was failing for object, but I added another union for roAssociativeArray to ensure that pattern works as well:
it.only('allows member access of union with invalid',()=>{program.setFile('source/main.bs',` sub test() channel = invalid if true channel = { height: 123 } end if if true channel = createChannel({ height: 123 }) end if height = 0 if channel <> invalid then height += channel.height end if end sub function createChannel(config) as object return config end function `);program.validate();expectZeroDiagnostics(program);});
This should not be an error, because the variable is
dynamic
.Discovered in the latest commits in v1 on Dec 23, 2024
The text was updated successfully, but these errors were encountered: