From 69484195951f3be2b7a9cadab8e26349027f8d4c Mon Sep 17 00:00:00 2001 From: Ned Palacios <7358345+nedpals@users.noreply.github.com> Date: Fri, 9 Apr 2021 23:18:22 +0800 Subject: [PATCH] parser: fix InterfaceDecl's position (#9649) --- vlib/v/checker/tests/incorrect_name_interface.out | 2 +- vlib/v/parser/struct.v | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/tests/incorrect_name_interface.out b/vlib/v/checker/tests/incorrect_name_interface.out index 47d6a17067..95a49b9ff1 100644 --- a/vlib/v/checker/tests/incorrect_name_interface.out +++ b/vlib/v/checker/tests/incorrect_name_interface.out @@ -1,3 +1,3 @@ vlib/v/checker/tests/incorrect_name_interface.vv:1:1: error: interface name `_MyInterface` must begin with capital letter 1 | interface _MyInterface {} - | ~~~~~~~~~ \ No newline at end of file + | ~~~~~~~~~~~~~~~~~~~~~~~~~ \ No newline at end of file diff --git a/vlib/v/parser/struct.v b/vlib/v/parser/struct.v index 1bcf0ad181..955951f6b5 100644 --- a/vlib/v/parser/struct.v +++ b/vlib/v/parser/struct.v @@ -571,7 +571,7 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl { ts.info = info p.top_level_statement_end() p.check(.rcbr) - pos.update_last_line(p.prev_tok.line_nr) + pos = pos.extend_with_last_line(p.prev_tok.position(), p.prev_tok.line_nr) return ast.InterfaceDecl{ name: interface_name fields: fields