tests: preserve rejection contexts and normalize callee effects
This commit is contained in:
1 parent
06d8a1a76a
commit
fd92604f36
11 files changed
+344
-35
No files matched your search
@@ -0,0 +1,13 @@
|
||||
// own.new receives cap<fs.read> where the allocation needs cap<mem.alloc>.
|
||||
// phase: 6
|
||||
// spec: docs/spec/05-effects-and-capabilities.md §10.5
|
||||
// expect: reject E3201
|
||||
// AIR twin: phase2/reject/alloc_wrong_capability.air
|
||||
module test.source_alloc_wrong_capability
|
||||
fn f(heap: cap<fs.read>) -> void effects [mem.alloc] {
|
||||
match own.new(1u64, heap) { // diagnostic here: own.new
|
||||
ok(o) => { own.free(move o); }
|
||||
err(e) => {}
|
||||
}
|
||||
}
|
||||
fn main() -> u64 effects [] { return 0u64; }
|
||||
Reference in new issue
Block a user