mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: minor vfmt run
This commit is contained in:
parent
3c90da6afa
commit
059722f211
@ -1129,10 +1129,10 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type {
|
|||||||
c.warn('function `$f.name` has been deprecated', call_expr.pos)
|
c.warn('function `$f.name` has been deprecated', call_expr.pos)
|
||||||
}
|
}
|
||||||
if f.is_unsafe && !c.inside_unsafe &&
|
if f.is_unsafe && !c.inside_unsafe &&
|
||||||
f.language == .c && f.name[2] in [`m`, `s`] && f.mod == 'builtin' {
|
f.language == .c && f.name[2] in [`m`, `s`] &&
|
||||||
|
f.mod == 'builtin' {
|
||||||
// builtin C.m*, C.s* only - temp
|
// builtin C.m*, C.s* only - temp
|
||||||
c.warn('function `$f.name` must be called from an `unsafe` block',
|
c.warn('function `$f.name` must be called from an `unsafe` block', call_expr.pos)
|
||||||
call_expr.pos)
|
|
||||||
}
|
}
|
||||||
if f.is_generic && f.return_type.has_flag(.generic) {
|
if f.is_generic && f.return_type.has_flag(.generic) {
|
||||||
rts := c.table.get_type_symbol(f.return_type)
|
rts := c.table.get_type_symbol(f.return_type)
|
||||||
@ -2962,8 +2962,7 @@ pub fn (mut c Checker) postfix_expr(mut node ast.PostfixExpr) table.Type {
|
|||||||
return typ
|
return typ
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (mut c Checker) check_index_type(typ_sym &table.TypeSymbol, index_type table.Type,
|
fn (mut c Checker) check_index_type(typ_sym &table.TypeSymbol, index_type table.Type, pos token.Position) {
|
||||||
pos token.Position) {
|
|
||||||
index_type_sym := c.table.get_type_symbol(index_type)
|
index_type_sym := c.table.get_type_symbol(index_type)
|
||||||
// println('index expr left=$typ_sym.name $node.pos.line_nr')
|
// println('index expr left=$typ_sym.name $node.pos.line_nr')
|
||||||
// if typ_sym.kind == .array && (!(table.type_idx(index_type) in table.number_type_idxs) &&
|
// if typ_sym.kind == .array && (!(table.type_idx(index_type) in table.number_type_idxs) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user