Bug 21764 – checkaction=context doesn't work for empty tuples

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-25T01:36:15Z
Last change time
2021-03-25T03:30:47Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2021-03-25T01:36:15Z
----------------------------------------------- struct S {} void main() { S s; assert(s.tupleof != s.tupleof); } ----------------------------------------------- checkaction.d(6): Error: template `core.internal.dassert._d_assert_fail` cannot deduce function from argument types `!()(string)`, candidates are: ./generated/linux/release/64/../../../../../druntime/import/core/internal/dassert.d(38): `_d_assert_fail(A)(scope const string op, auto ref scope const A a)` ./generated/linux/release/64/../../../../../druntime/import/core/internal/dassert.d(59): `_d_assert_fail(A...)` ./generated/linux/release/64/../../../../../druntime/import/core/internal/dassert.d(76): `_d_assert_fail(A, B)(scope const string comp, auto ref scope const A a, auto ref scope const B b)`
Comment #1 by dlang-bot — 2021-03-25T01:45:19Z
@MoonlightSentinel created dlang/druntime pull request #3411 "Fix 21764 - checkaction=context doesn't work for empty tuples" fixing this issue: - Fix 21764 - checkaction=context doesn't work for empty tuples 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 `()`. https://github.com/dlang/druntime/pull/3411
Comment #2 by dlang-bot — 2021-03-25T03:30:47Z
dlang/druntime pull request #3411 "Fix 21764 - checkaction=context doesn't work for empty tuples" was merged into master: - d4c1d376e4cfeb0882316b06fa6d8c1db7de8981 by MoonlightSentinel: Fix 21764 - checkaction=context doesn't work for empty tuples 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 `()`. https://github.com/dlang/druntime/pull/3411