Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checker: fix checking mismatch of the fn array decompose argument (#1…
- Loading branch information
Showing
5 changed files
with
33 additions
and
9 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
2 changes: 1 addition & 1 deletion
2
...s/fn_array_decompose_arg_mismatch_err.out → ...fn_array_decompose_arg_mismatch_err_a.out
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
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
vlib/v/checker/tests/fn_array_decompose_arg_mismatch_err_b.out
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,6 @@ | ||
vlib/v/checker/tests/fn_array_decompose_arg_mismatch_err_b.vv:14:4: error: cannot use `...Foo1` as `...Foo` in argument 1 to `f` | ||
12 | | ||
13 | fn main() { | ||
14 | f(...[Foo1{}, Foo1{}]) | ||
| ~~~~~~~~~~~~~~~~~~~ | ||
15 | } |
15 changes: 15 additions & 0 deletions
15
vlib/v/checker/tests/fn_array_decompose_arg_mismatch_err_b.vv
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,15 @@ | ||
struct Foo1 { | ||
} | ||
|
||
struct Foo2 { | ||
} | ||
|
||
type Foo = Foo1 | Foo2 | ||
|
||
fn f(v ...Foo) { | ||
println(v) | ||
} | ||
|
||
fn main() { | ||
f(...[Foo1{}, Foo1{}]) | ||
} |