www.fgks.org   »   [go: up one dir, main page]

Issue 21764 - checkaction=context doesn't work for empty tuples
Summary: checkaction=context doesn't work for empty tuples
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-03-25 01:36 UTC by moonlightsentinel
Modified: 2021-03-25 03:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2021-03-25 01:36:15 UTC
-----------------------------------------------
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 Dlang Bot 2021-03-25 01:45:19 UTC
@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 Dlang Bot 2021-03-25 03:30:47 UTC
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