1
0
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:
Makhnev Petr 2023-01-23 13:05:34 +04:00 committed by GitHub
parent 3df231c466
commit 3a9355d898
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -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).

View File

@ -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)
}
}

View File

@ -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'

View File

@ -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 {