Skip to content

Commit

Permalink
Restore checker regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertzui123 committed Oct 9, 2023
1 parent a1616db commit d115fa8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Empty file.
12 changes: 12 additions & 0 deletions vlib/v/checker/tests/immutable_deref.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
struct Context {}

const ctx_ptr = &Context(unsafe { nil })

fn main() {
// TODO unsafe bug, having this declaration inside `unsafe` results in an error
x := &ctx_ptr
unsafe {
*x = &Context{}
_ = x
}
}

0 comments on commit d115fa8

Please sign in to comment.