checker: fix warning at comptime call (#8248)
parent
0d204603d1
commit
6b1956fb60
|
@ -3605,6 +3605,11 @@ fn (mut c Checker) comptime_call(mut node ast.ComptimeCall) table.Type {
|
|||
if node.method_name == 'html' {
|
||||
return c.table.find_type_idx('vweb.Result')
|
||||
}
|
||||
mut var := c.fn_scope.objects[node.method_name]
|
||||
if mut var is ast.Var {
|
||||
var.is_used = true
|
||||
c.fn_scope.objects[node.method_name] = var
|
||||
}
|
||||
return table.string_type
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
struct Test {}
|
||||
|
||||
fn (test Test) print() {
|
||||
println('test')
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test := Test{}
|
||||
abc := 'print'
|
||||
test.$abc()
|
||||
}
|
Loading…
Reference in New Issue