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

parser: smartcast fix (#5756)

This commit is contained in:
Daniel Däschle 2020-07-08 16:08:44 +02:00 committed by GitHub
parent f834276803
commit e7cd496c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,9 +129,9 @@ fn (mut p Parser) vweb() ast.ComptimeCall {
// copy vars from current fn scope into vweb_tmpl scope
for stmt in file.stmts {
if stmt is ast.FnDecl {
fn_decl := stmt as ast.FnDecl
if fn_decl.name == 'main.vweb_tmpl_$p.cur_fn_name' {
tmpl_scope := file.scope.innermost(fn_decl.body_pos.pos)
if it.name == 'main.vweb_tmpl_$p.cur_fn_name' {
fn_decl := it
tmpl_scope := file.scope.innermost(it.body_pos.pos)
for _, obj in p.scope.objects {
if obj is ast.Var {
mut v := it