mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
change or{}
to or {}
as most other places (#17082)
This commit is contained in:
parent
3df231c466
commit
3a9355d898
@ -1,6 +1,6 @@
|
||||
## V 0.3.3
|
||||
*Not yet released*
|
||||
- Accessing a pointer map value requires an `or{}` block outside `unsafe`.
|
||||
- Accessing a pointer map value requires an `or {}` block outside `unsafe`.
|
||||
- `math.vec` module for generic vector math.
|
||||
- `go foo()` has been replaced with `spawn foo()` (launches an OS thread, `go` will be used for
|
||||
upcoming coroutines instead).
|
||||
|
@ -3874,7 +3874,7 @@ fn (mut c Checker) index_expr(mut node ast.IndexExpr) ast.Type {
|
||||
&& typ_sym.kind == .map && node.or_expr.stmts.len == 0 {
|
||||
elem_type := c.table.value_type(typ)
|
||||
if elem_type.is_real_pointer() {
|
||||
c.note('accessing a pointer map value requires an `or{}` block outside `unsafe`',
|
||||
c.note('accessing a pointer map value requires an `or {}` block outside `unsafe`',
|
||||
node.pos)
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
vlib/v/checker/tests/map_index_reference_value.vv:7:3: notice: accessing a pointer map value requires an `or{}` block outside `unsafe`
|
||||
vlib/v/checker/tests/map_index_reference_value.vv:7:3: notice: accessing a pointer map value requires an `or {}` block outside `unsafe`
|
||||
5 | fn main() {
|
||||
6 | mut m := map[string]&Foo{}
|
||||
7 | m['bar'].bar = 'bar'
|
||||
|
@ -2937,7 +2937,7 @@ fn (mut g Gen) autofree_scope_vars2(scope &ast.Scope, start_pos int, end_pos int
|
||||
if obj.is_or {
|
||||
// Skip vars inited with the `or {}`, since they are generated
|
||||
// after the or block in C.
|
||||
g.trace_autofree('// skipping `or{}` var "${obj.name}"')
|
||||
g.trace_autofree('// skipping `or {}` var "${obj.name}"')
|
||||
continue
|
||||
}
|
||||
if obj.is_tmp {
|
||||
|
Loading…
Reference in New Issue
Block a user