checker: array map fixes

pull/4113/head
Joe Conigliaro 2020-03-25 20:07:53 +11:00
parent b495e78f0e
commit 8ba46965b6
1 changed files with 2 additions and 2 deletions

View File

@ -278,8 +278,8 @@ pub fn (c mut Checker) method_call_expr(method_call_expr mut ast.MethodCallExpr)
name := method_call_expr.name
c.stmts(method_call_expr.or_block.stmts)
// println('method call $name $method_call_expr.pos.line_nr')
if typ_sym.kind == .array && name in ['filter', 'clone', 'repeat'] {
if name == 'filter' {
if typ_sym.kind == .array && name in ['filter', 'clone', 'repeat', 'reverse', 'map'] {
if name in ['filter', 'map'] {
array_info := typ_sym.info as table.Array
mut scope := c.file.scope.innermost(method_call_expr.pos.pos)
scope.override_var(ast.Var{