sway
sway copied to clipboard
Properly support divergence in DCA
Currently DCA automatically connects the return node to all of its containing nodes making all of them accessible and thus not-dead. This removes dead-code warnings in cases of divergence as shown in the example below. The variable a is never used because of the nested return but the warning is not generated.
script;
fn main() -> [u64;3] {
let a = 123u64;
return [0u64, return [1, 2, 3], a];
}