Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checker: produce more informative error messages on ~,!,-,<- operator…
… type mismatches
- Loading branch information
Showing
5 changed files
with
45 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:2:13: error: operator ~ only defined on int types | ||
1 | fn main() { | ||
2 | println(~3.0) | ||
| ^ | ||
3 | println(~10.5) | ||
4 | println(~'2') | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:3:13: error: operator ~ only defined on int types | ||
1 | fn main() { | ||
2 | println(~3.0) | ||
3 | println(~10.5) | ||
| ^ | ||
4 | println(~'2') | ||
5 | println(~[2, 4, 6]) | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:4:13: error: operator ~ only defined on int types | ||
2 | println(~3.0) | ||
3 | println(~10.5) | ||
4 | println(~'2') | ||
| ^ | ||
5 | println(~[2, 4, 6]) | ||
6 | } | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:5:13: error: operator ~ only defined on int types | ||
3 | println(~10.5) | ||
4 | println(~'2') | ||
5 | println(~[2, 4, 6]) | ||
| ^ | ||
6 | } | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:2:13: error: operator `~` can only be used with integer types, but the value after `~` is of type `float literal` instead | ||
1 | fn main() { | ||
2 | println(~3.0) | ||
| ^ | ||
3 | println(~10.5) | ||
4 | println(~'2') | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:3:13: error: operator `~` can only be used with integer types, but the value after `~` is of type `float literal` instead | ||
1 | fn main() { | ||
2 | println(~3.0) | ||
3 | println(~10.5) | ||
| ^ | ||
4 | println(~'2') | ||
5 | println(~[2, 4, 6]) | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:4:13: error: operator `~` can only be used with integer types, but the value after `~` is of type `string` instead | ||
2 | println(~3.0) | ||
3 | println(~10.5) | ||
4 | println(~'2') | ||
| ^ | ||
5 | println(~[2, 4, 6]) | ||
6 | } | ||
vlib/v/checker/tests/invert_other_types_bits_error.vv:5:13: error: operator `~` can only be used with integer types, but the value after `~` is of type `[]int` instead | ||
3 | println(~10.5) | ||
4 | println(~'2') | ||
5 | println(~[2, 4, 6]) | ||
| ^ | ||
6 | } |
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