aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/use_after_inferred_give.zc
blob: e393c29f6930a0eaf023c902e40daa9cc8973667 (plain) (blame)
1
2
3
4
5
6
namespace;
include rt;

// expect: x: used after it was given away; x was given to take's .d parameter on line 6 (declared on line 6)
fn take(.d p) { return p[0]; }
fn main() { let x = rt.new(3); take(x); return x[0]; }