-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checker: check error of implementing other module private interface (fix
- Loading branch information
Showing
7 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
vlib/v/checker/tests/modules/implement_private_interface/main.v:7:16: error: `Bar` cannot implement private interface `baz.Foo` of other module | ||
5 | fn main() { | ||
6 | b := Bar{10} | ||
7 | baz.print_foo(b) // prints 10 | ||
| ^ | ||
8 | } | ||
9 | |
10 changes: 10 additions & 0 deletions
10
vlib/v/checker/tests/modules/implement_private_interface/baz.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// sub module | ||
module baz | ||
|
||
interface Foo { | ||
a int | ||
} | ||
|
||
pub fn print_foo(f Foo) { | ||
println(f.a) | ||
} |
12 changes: 12 additions & 0 deletions
12
vlib/v/checker/tests/modules/implement_private_interface/main.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module main | ||
|
||
import baz | ||
|
||
fn main() { | ||
b := Bar{10} | ||
baz.print_foo(b) // prints 10 | ||
} | ||
|
||
struct Bar { | ||
a int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[has_globals] | ||
module embed_file | ||
|
||
interface Decoder { | ||
pub interface Decoder { | ||
decompress([]u8) ![]u8 | ||
} | ||
|
||
|