Skip to content

Commit

Permalink
Add test for issue 286 (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilehmann authored Oct 11, 2023
1 parent cb5a2c1 commit 05a937e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/flux-tests/tests/neg/surface/arr02.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ fn test01() -> i32 {
*arr[1] += 1;
v1 //~ ERROR refinement type
}

#[flux::sig(fn() -> i32{v: v < 0})]
fn test02() -> i32 {
let v = 42;
let arr = [&v, &v];
*arr[0] //~ ERROR refinement type
}
7 changes: 7 additions & 0 deletions crates/flux-tests/tests/pos/surface/arr02.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ fn test01() -> i32 {
*arr[1] += 1;
v1
}

#[flux::sig(fn() -> i32{v: v >= 0})]
fn test02() -> i32 {
let v = 42;
let arr = [&v, &v];
*arr[0]
}

0 comments on commit 05a937e

Please sign in to comment.