Skip to content

Commit

Permalink
rebase and change pos
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Sep 15, 2024
1 parent 5fcfc27 commit 44f11a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vlib/v/checker/struct.v
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ fn (mut c Checker) struct_decl(mut node ast.StructDecl) {
}
}
}
} else {
c.error('`${t_sym.name}` is not an interface type', t.pos)
}
c.type_implements(struct_type, t.typ, node.pos)
}
Expand Down
5 changes: 5 additions & 0 deletions vlib/v/checker/tests/struct_implements_non_interface_err.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vlib/v/checker/tests/struct_implements_non_interface_err.vv:1:26: error: `Abcde` is not an interface type
1 | struct Walker implements Abcde {
| ~~~~~
2 | aaa string
3 | }
5 changes: 5 additions & 0 deletions vlib/v/checker/tests/struct_implements_non_interface_err.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
struct Walker implements Abcde {
aaa string
}

fn main() {}

0 comments on commit 44f11a7

Please sign in to comment.