Skip to content

Commit

Permalink
change the .vv sample with a more lightweight one, update the .out fi…
Browse files Browse the repository at this point in the history
…le for it
  • Loading branch information
spytheman committed Sep 17, 2024
1 parent 257a7f8 commit cdc6a1b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
vlib/v/checker/tests/struct_implements_interface_more_than_once_err.vv:4:35: error: struct type Walker cannot implement interface `v.ast.walker.Visitor more than once`
2 | import v.ast { Node }
3 |
4 | struct Walker implements Visitor, Visitor, Visitor {
| ~~~~~~~
5 | aaa string
6 | }
vlib/v/checker/tests/struct_implements_interface_more_than_once_err.vv:3:31: error: struct type Abc cannot implement interface `io.Writer more than once`
1 | import io { Writer }
2 |
3 | struct Abc implements Writer, Writer, Writer {
| ~~~~~~
4 | aaa string
5 | }
vlib/v/checker/tests/struct_implements_interface_more_than_once_err.vv:12:31: error: struct type Def cannot implement interface `io.Writer more than once`
10 |
11 | // vfmt off
12 | struct Def implements Writer, io.Writer {
| ~~
13 | aaa string
14 | }
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import v.ast.walker { Visitor }
import v.ast { Node }
import io { Writer }

struct Walker implements Visitor, Visitor, Visitor {
struct Abc implements Writer, Writer, Writer {
aaa string
}

fn (mut n Walker) visit(node &Node) ! {
panic('not implemented')
fn (a Abc) write(buf []u8) !int {
return 42
}

// vfmt off
struct Def implements Writer, io.Writer {
aaa string
}
// vfmt on

fn (a Def) write(buf []u8) !int {
return 42
}

0 comments on commit cdc6a1b

Please sign in to comment.