@@ -126,7 +126,7 @@ fn (mut c Checker) check_types(got ast.Type, expected ast.Type) bool {
126
126
if exp_idx == ast.voidptr_type_idx || exp_idx == ast.nil_type_idx
127
127
|| exp_idx == ast.byteptr_type_idx
128
128
|| (expected.is_ptr () && expected.deref ().idx () == ast.u8_ type_idx) {
129
- if got.is_ptr () || got. is_pointer () {
129
+ if got.is_any_kind_of_pointer () {
130
130
return true
131
131
}
132
132
}
@@ -140,7 +140,7 @@ fn (mut c Checker) check_types(got ast.Type, expected ast.Type) bool {
140
140
if got_idx == ast.voidptr_type_idx || got_idx == ast.nil_type_idx
141
141
|| got_idx == ast.byteptr_type_idx
142
142
|| (got_idx == ast.u8_ type_idx && got.is_ptr ()) {
143
- if expected.is_ptr () || expected. is_pointer () {
143
+ if expected.is_any_kind_of_pointer () {
144
144
return true
145
145
}
146
146
}
@@ -375,7 +375,7 @@ fn (mut c Checker) check_basic(got ast.Type, expected ast.Type) bool {
375
375
}
376
376
}
377
377
if ! unalias_got.is_ptr () && got_sym.kind == .array_fixed
378
- && ( unalias_expected.is_pointer () || unalias_expected. is_ptr () ) {
378
+ && unalias_expected.is_any_kind_of_pointer ( ) {
379
379
// fixed array needs to be a struct, not a pointer
380
380
return false
381
381
}
@@ -440,8 +440,8 @@ fn (mut c Checker) check_matching_function_symbols(got_type_sym &ast.TypeSymbol,
440
440
exp_arg := exp_fn.params[i]
441
441
exp_arg_typ := c.unwrap_generic (exp_arg.typ)
442
442
got_arg_typ := c.unwrap_generic (got_arg.typ)
443
- exp_arg_is_ptr := exp_arg_typ.is_ptr () || exp_arg_typ. is_pointer ()
444
- got_arg_is_ptr := got_arg_typ.is_ptr () || got_arg_typ. is_pointer ()
443
+ exp_arg_is_ptr := exp_arg_typ.is_any_kind_of_pointer ()
444
+ got_arg_is_ptr := got_arg_typ.is_any_kind_of_pointer ()
445
445
if exp_arg.is_mut && ! got_arg.is_mut {
446
446
return false
447
447
}
@@ -671,13 +671,13 @@ fn (c &Checker) expected_msg(got ast.Type, expected ast.Type) string {
671
671
fn (mut c Checker) symmetric_check (left ast.Type, right ast.Type) bool {
672
672
// allow direct int-literal assignment for pointers for now
673
673
// maybe in the future options should be used for that
674
- if right.is_ptr () || right. is_pointer () {
674
+ if right.is_any_kind_of_pointer () {
675
675
if left == ast.int_literal_type {
676
676
return true
677
677
}
678
678
}
679
679
// allow direct int-literal assignment for pointers for now
680
- if left.is_ptr () || left. is_pointer () {
680
+ if left.is_any_kind_of_pointer () {
681
681
if right == ast.int_literal_type {
682
682
return true
683
683
}
0 commit comments