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

checker: array slice type

This commit is contained in:
Joe Conigliaro 2020-03-26 22:04:24 +11:00
parent fc86269bc9
commit b1d15afe61

View File

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