Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix 21764 - checkaction=context doesn't work for empty tuples #3411

Merged
merged 1 commit into from Mar 25, 2021

Conversation

MoonlightSentinel
Copy link
Contributor

The template constraint was intended to avoid collisions with the
unary hook but also prevented instances for zero elements.

combine was adapted to print empty arrays as ().

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
21764 minor checkaction=context doesn't work for empty tuples

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3411"

@dlang-bot dlang-bot added the Bug Fix Include reference to corresponding bugzilla issue label Mar 25, 2021
@@ -60,7 +60,7 @@ template _d_assert_fail(A...)
{
string _d_assert_fail(B...)(
const scope string comp, auto ref const scope A a, auto ref const scope B b)
if (B.length > 0)
if (B.length > 0 || !A.length)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't that mean assert(NonEmptyTuple == EmptyTuple) will not work ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. But is this even possible to compare tuples with different lengths?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onlineapp.d(6): Error: mismatched tuple lengths, 3 and 1

Guess not :D

The template constraint was intended to avoid collisions with the
unary hook but also prevented instances for zero elements.

`combine` was adapted to print empty arrays as `()`.
@dlang-bot dlang-bot merged commit 59320f1 into dlang:master Mar 25, 2021
@ibuclaw
Copy link
Member

ibuclaw commented Mar 25, 2021

This is causing all pipelines to fail in dmd master.

@MoonlightSentinel
Copy link
Contributor Author

MoonlightSentinel commented Mar 25, 2021

That weird. Seems like the CI's used an outdated ref?
(The dmd side was merged before this PR)

@MoonlightSentinel MoonlightSentinel deleted the empty-tuple branch March 25, 2021 11:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Fix Include reference to corresponding bugzilla issue
Projects
None yet
5 participants