Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to work with Vlang 0.4.9 #237

Merged
merged 2 commits into from
Jan 17, 2025
Merged

Conversation

kahgoh
Copy link
Member

@kahgoh kahgoh commented Jan 16, 2025

The commits in this PR fixes a build failure and a warning in the CI https://github.com/exercism/vlang/actions/runs/12798355176/job/35682210581?pr=236.

More specifically, the error is:

 ---- Testing... ----------------------------------------------------------------
Error: temp/run_test.v:34:44: error: array_init: no type specified (maybe: `[]Type{}` instead of `[]`)
   32 | 
   33 | fn test_concat_list_of_nested_lists() {
   34 |     assert concat[[]int]([[[1], [2]], [[3]], [[]], [[4, 5, 6]]]) == [
      |                                               ~~~
   35 |         [1],
   36 |         [2],
Error: temp/run_test.v:34:44: error: invalid void array element type
   32 | 
   33 | fn test_concat_list_of_nested_lists() {
   34 |     assert concat[[]int]([[[1], [2]], [[3]], [[]], [[4, 5, 6]]]) == [
      |                                               ~~~
   35 |         [1],
   36 |         [2],
Error: temp/run_test.v:34:43: error: invalid array element: expected `[][]int`, not `[]void`
   32 | 
   33 | fn test_concat_list_of_nested_lists() {
   34 |     assert concat[[]int]([[[1], [2]], [[3]], [[]], [[4, 5, 6]]]) == [
      |                                              ~~~~
   35 |         [1],
   36 |         [2],
checker summary: 3 V errors, 0 V warnings, 0 V notices

and the warning is:

Warning: temp/parallel_letter_frequency.v:9:13: warning: function `encoding.utf8.get_uchar` has been deprecated since 2024-11-17, it will be an error after 2025-05-16; use `.get_rune(s string, index int)` instead
--------------------------------------------------------------------------------
    7 |     lower := utf8.to_lower(word)
    8 |     for r in 0 .. utf8.len(lower) {
    9 |         c := utf8.get_uchar(lower, r)
      |                   ~~~~~~~~~~~~~~~~~~~
   10 |         if utf8.is_letter(rune(c)) {
   11 |             result[c]++

This is to fix the following error in the CI build:

  error: array_init: no type specified (maybe: `[]Type{}` instead of `[]`)

This probably started happening with Vlang 0.4.9, which has changes
to empty arrays (see vlang/v#22828 and
https://github.com/vlang/v/blob/master/CHANGELOG.md).
This is to fix the following warning:

  warning: function `encoding.utf8.get_uchar` has been deprecated since 2024-11-17, it will be an error after 2025-05-16; use `.get_rune(s string, index int)` instead
Copy link

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@keiravillekode keiravillekode merged commit f7f3fd7 into exercism:main Jan 17, 2025
6 checks passed
@kahgoh kahgoh deleted the fix/ci branch January 17, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants