1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v2: handle var decl & assign stmt together 1st step combining

This commit is contained in:
Joe Conigliaro
2020-02-28 23:29:04 +11:00
parent 8c43644301
commit c4b9ef388f
7 changed files with 124 additions and 99 deletions

View File

@@ -370,6 +370,10 @@ pub fn (t &Table) check(got, expected Type) bool {
if got_type_sym.is_number() && exp_type_sym.is_number() {
return true
}
// check hack in checker IndexExpr line #691
if type_is_ptr(got) && got_type_sym.kind == .byte && exp_type_sym.kind == .byteptr {
return true
}
// TODO
// if got_type_sym.kind == .array && exp_type_sym.kind == .array {
// return true

View File

@@ -98,7 +98,7 @@ pub fn new_type_ptr(idx int, nr_muls int) Type {
}
pub const (
number_idxs = [int_type_idx, byte_type_idx, u64_type_idx]
number_idxs = [int_type_idx, byte_type_idx, u32_type_idx, u64_type_idx]
)
/*