checker: minor clean up in comptime_call() (#12860)
parent
d8a333058d
commit
674f99a658
|
@ -9,7 +9,6 @@ import v.util
|
||||||
import v.pkgconfig
|
import v.pkgconfig
|
||||||
|
|
||||||
fn (mut c Checker) comptime_call(mut node ast.ComptimeCall) ast.Type {
|
fn (mut c Checker) comptime_call(mut node ast.ComptimeCall) ast.Type {
|
||||||
sym := c.table.get_type_symbol(c.unwrap_generic(c.expr(node.left)))
|
|
||||||
node.left_type = c.expr(node.left)
|
node.left_type = c.expr(node.left)
|
||||||
if node.is_env {
|
if node.is_env {
|
||||||
env_value := util.resolve_env_value("\$env('$node.args_var')", false) or {
|
env_value := util.resolve_env_value("\$env('$node.args_var')", false) or {
|
||||||
|
@ -94,11 +93,11 @@ fn (mut c Checker) comptime_call(mut node ast.ComptimeCall) ast.Type {
|
||||||
} else {
|
} else {
|
||||||
c.error('todo: not a string literal', node.method_pos)
|
c.error('todo: not a string literal', node.method_pos)
|
||||||
}
|
}
|
||||||
f := sym.find_method(method_name) or {
|
left_sym := c.table.get_type_symbol(c.unwrap_generic(node.left_type))
|
||||||
|
f := left_sym.find_method(method_name) or {
|
||||||
c.error('could not find method `$method_name`', node.method_pos)
|
c.error('could not find method `$method_name`', node.method_pos)
|
||||||
return ast.void_type
|
return ast.void_type
|
||||||
}
|
}
|
||||||
// println(f.name + ' ' + c.table.type_to_str(f.return_type))
|
|
||||||
node.result_type = f.return_type
|
node.result_type = f.return_type
|
||||||
return f.return_type
|
return f.return_type
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue