mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v2: add UnsafeStmt to checker & byte/byteptr to check
This commit is contained in:
parent
7daf8f8fd0
commit
8458ea40f0
@ -457,6 +457,11 @@ fn (c mut Checker) stmt(node ast.Stmt) {
|
||||
c.return_stmt(it)
|
||||
}
|
||||
// ast.StructDecl {}
|
||||
ast.UnsafeStmt {
|
||||
for stmt in it.stmts {
|
||||
c.stmt(stmt)
|
||||
}
|
||||
}
|
||||
ast.VarDecl {
|
||||
typ := c.expr(it.expr)
|
||||
it.typ = typ
|
||||
|
@ -398,8 +398,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 {
|
||||
// TODO: actually check for & handle pointers with name_expr
|
||||
// see hack in checker IndexExpr line #691
|
||||
if (got_type_sym.kind == .byte && exp_type_sym.kind == .byteptr) ||
|
||||
(exp_type_sym.kind == .byte && got_type_sym.kind == .byteptr) {
|
||||
return true
|
||||
}
|
||||
// TODO
|
||||
|
Loading…
Reference in New Issue
Block a user