Fix 21764 - checkaction=context doesn't work for empty tuples #3411
Conversation
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 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
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#3411" |
src/core/internal/dassert.d
Outdated
@@ -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) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
96b794f
to
cb5709b
Compare
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 `()`.
cb5709b
to
d4c1d37
Compare
This is causing all pipelines to fail in dmd master. |
That weird. Seems like the CI's used an outdated ref? |
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()
.