-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Peer Type Resolution fails with Homogeneous tuple and array. #15138
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
Milestone
Comments
PastMoments
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Apr 1, 2023
Vexu
added
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
and removed
bug
Observed behavior contradicts documented or intended behavior
labels
Apr 2, 2023
mlugg
added a commit
to mlugg/zig
that referenced
this issue
May 21, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
mlugg
added a commit
to mlugg/zig
that referenced
this issue
May 21, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
mlugg
added a commit
to mlugg/zig
that referenced
this issue
May 21, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
mlugg
added a commit
to mlugg/zig
that referenced
this issue
Jun 13, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
mlugg
added a commit
to mlugg/zig
that referenced
this issue
Jun 13, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
wooster0
pushed a commit
to wooster0/zig
that referenced
this issue
Jun 15, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
wooster0
pushed a commit
to wooster0/zig
that referenced
this issue
Jun 15, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
wooster0
pushed a commit
to wooster0/zig
that referenced
this issue
Jun 15, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
wooster0
pushed a commit
to wooster0/zig
that referenced
this issue
Jun 15, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
wooster0
pushed a commit
to wooster0/zig
that referenced
this issue
Jun 15, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
wooster0
pushed a commit
to wooster0/zig
that referenced
this issue
Jun 15, 2023
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
TUSF
pushed a commit
to TUSF/zig
that referenced
this issue
May 9, 2024
The existing logic for peer type resolution was quite convoluted and buggy. This rewrite makes it much more resilient, readable, and extensible. The algorithm works by first iterating over the types to select a "strategy", then applying that strategy, possibly applying peer resolution recursively. Several new tests have been added to cover cases which the old logic did not correctly handle. Resolves: ziglang#15138 Resolves: ziglang#15644 Resolves: ziglang#15693 Resolves: ziglang#15709 Resolves: ziglang#15752
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
Zig Version
0.10.1
Steps to Reproduce and Observed Behavior
Coercing from a homogeneous tuple to an array works as it should. However, peer type resolution between the two same types will fail.
This appears to contradict this line in the documentation:
This kind of type resolution chooses a type that all peer types can coerce into.
Both the types coerce into the array, thus the peer type resolution should succeed.Side question: Is there a reason an array can't coerce into a tuple?
Expected Behavior
In the above example,
@TypeOf(x,y)
should give[8]i16
.The text was updated successfully, but these errors were encountered: