File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -799,7 +799,10 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
799799 }
800800 if p.tok.kind.is_start_of_type () && p.tok.line_nr == line_nr {
801801 method.return_type_pos = p.tok.pos ()
802+ last_inside_return := p.inside_fn_return
803+ p.inside_fn_return = true
802804 method.return_type = p.parse_type ()
805+ p.inside_fn_return = last_inside_return
803806 method.return_type_pos = method.return_type_pos.extend (p.tok.pos ())
804807 method.pos = method.pos.extend (method.return_type_pos)
805808 }
Original file line number Diff line number Diff line change 1+ interface IValue {
2+ value () [2 ]int
3+ }
4+
5+ struct Speed {
6+ data [2 ]int
7+ }
8+
9+ fn (s Speed) value () [2 ]int {
10+ return s.data
11+ }
12+
13+ fn get_value (v IValue) [2 ]int {
14+ return v.value ()
15+ }
16+
17+ fn test_main () {
18+ s := Speed{[35 , 36 ]! }
19+ assert get_value (s) == [35 , 36 ]!
20+ }
You can’t perform that action at this time.
0 commit comments