Skip to content

Commit f8da25e

Browse files
committed
fix
1 parent 6e24b5d commit f8da25e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
vlib/v/checker/tests/immutable_deref.vv:6:7: error: cannot have mutable reference to const `ctx_ptr`
2+
4 |
3+
5 | fn main() {
4+
6 | x := &ctx_ptr
5+
| ^
6+
7 | unsafe {
7+
8 | *x = &Context{}

vlib/v/checker/tests/immutable_deref.vv

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ struct Context {}
33
const ctx_ptr = &Context(unsafe { nil })
44

55
fn main() {
6-
// TODO: unsafe bug, having this declaration inside `unsafe` results in an error
76
x := &ctx_ptr
87
unsafe {
98
*x = &Context{}

0 commit comments

Comments
 (0)