aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/use_after_global.zc
blob: 01a69c05450413701fc09c0b3ff6a44b633f0f53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
namespace;
include rt;

// expect: a: used after it was given away; a was stored in a global or untracked memory on line 8 (declared on line 7)
word g;
fn main() {
	let a = rt.new(4);
	g = a;
	return a[0];
}