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

exercises(queen-attack): example: fix for Zig 0.12.0-dev #368

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Jan 8, 2024

At the time of writing, Zig master supports every test file on the track. However, Zig master no longer supports some of the example solutions in this repo. Work towards that.

The track officially supports only Zig 0.11.0, but I'd like to support Zig master too when we can do that in a backwards-compatible way.


Resolve this error from the latest Zig master release:

$ zig version
0.12.0-dev.2063+804cee3b9
$ bin/run-tests queen-attack
Running tests for queen-attack...
queen_attack.zig:28:18: error: root struct of file 'math' has no member named 'absInt'
            (math.absInt(self.row - other.row) catch unreachable ==
             ~~~~^~~~~~~
/opt/zig/lib/std/math.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
referenced by:
    test.cannot attack if falling diagonals are only the same when reflected across the longest falling diagonal: test_queen_attack.zig:87:34
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

Resolve this error from the latest Zig master release:

    $ zig version
    0.12.0-dev.2063+804cee3b9
    $ bin/run-tests queen-attack
    Running tests for queen-attack...
    queen_attack.zig:28:18: error: root struct of file 'math' has no member named 'absInt'
                (math.absInt(self.row - other.row) catch unreachable ==
                 ~~~~^~~~~~~
    /opt/zig/lib/std/math.zig:1:1: note: struct declared here
    const builtin = @import("builtin");
    ^~~~~
    referenced by:
        test.cannot attack if falling diagonals are only the same when reflected across the longest falling diagonal: test_queen_attack.zig:87:34
        remaining reference traces hidden; use '-freference-trace' to see all reference traces
@ee7 ee7 requested a review from booniepepper January 8, 2024 09:19
@ee7 ee7 requested a review from ErikSchierboom January 25, 2024 18:33
@ee7 ee7 merged commit 9cb56b3 into exercism:main Jan 25, 2024
7 checks passed
@ee7 ee7 deleted the queen-attack-example-Zig-master branch January 25, 2024 19:32
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