checker: fix typos in chan (#6539)

pull/6474/head
Swastik Baranwal 2020-10-03 10:29:30 +05:30 committed by GitHub
parent eefe067c27
commit c8a884f57f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -760,7 +760,7 @@ pub fn (mut c Checker) infix_expr(mut infix_expr ast.InfixExpr) table.Type {
c.fail_if_immutable(infix_expr.right)
}
if elem_type.is_ptr() && !right_type.is_ptr() {
c.error('cannon push non-reference `$right.source_name` on `$left.source_name`',
c.error('cannot push non-reference `$right.source_name` on `$left.source_name`',
right_pos)
}
} else {
@ -3721,7 +3721,7 @@ pub fn (mut c Checker) chan_init(mut node ast.ChanInit) table.Type {
}
pub fn (mut c Checker) map_init(mut node ast.MapInit) table.Type {
// `x ;= map[string]string` - set in parser
// `x := map[string]string` - set in parser
if node.typ != 0 {
info := c.table.get_type_symbol(node.typ).map_info()
key_sym := c.table.get_type_symbol(info.key_type)

View File

@ -5,7 +5,7 @@ vlib/v/checker/tests/chan_mut.vv:8:8: error: `v` is immutable, declare it with `
| ^
9 | mut w := St{}
10 | ch <- w
vlib/v/checker/tests/chan_mut.vv:10:8: error: cannon push non-reference `St` on `chan mut St`
vlib/v/checker/tests/chan_mut.vv:10:8: error: cannot push non-reference `St` on `chan mut St`
8 | ch <- v
9 | mut w := St{}
10 | ch <- w
@ -19,7 +19,7 @@ vlib/v/checker/tests/chan_mut.vv:12:8: error: `x` is immutable, declare it with
| ^
13 | mut y := St{}
14 | ch <- y
vlib/v/checker/tests/chan_mut.vv:14:8: error: cannon push non-reference `St` on `chan mut St`
vlib/v/checker/tests/chan_mut.vv:14:8: error: cannot push non-reference `St` on `chan mut St`
12 | ch <- x
13 | mut y := St{}
14 | ch <- y

View File

@ -1,11 +1,11 @@
vlib/v/checker/tests/chan_ref.vv:10:8: error: cannon push non-reference `St` on `chan &St`
vlib/v/checker/tests/chan_ref.vv:10:8: error: cannot push non-reference `St` on `chan &St`
8 | fn f(ch chan &St, sem sync.Semaphore) {
9 | w := St{}
10 | ch <- w
| ^
11 | mut x := St{}
12 | ch <- x
vlib/v/checker/tests/chan_ref.vv:12:8: error: cannon push non-reference `St` on `chan &St`
vlib/v/checker/tests/chan_ref.vv:12:8: error: cannot push non-reference `St` on `chan &St`
10 | ch <- w
11 | mut x := St{}
12 | ch <- x