Thread overview
[Issue 23626] [REG2.096] Template deduction with auto const ref Args... and delegate
Jan 14, 2023
Iain Buclaw
Jan 14, 2023
Iain Buclaw
Jan 14, 2023
Iain Buclaw
Jan 14, 2023
Iain Buclaw
Jan 14, 2023
Dlang Bot
Jan 15, 2023
Dlang Bot
Jan 15, 2023
Dlang Bot
Jan 16, 2023
Dlang Bot
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

johanengelen@weka.io changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry, rejects-valid

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

--- Comment #1 from johanengelen@weka.io ---
This frontend change "fixes" the errors (3 lines removed):
diff dmd/mtype.d:
```
    /** Extends TypeNext.constConv by also checking for matching attributes **/
    override MATCH constConv(Type to)
    {
-        // Attributes need to match exactly, otherwise it's an implicit
conversion
-        if (this.ty != to.ty || !this.attributesEqual(cast(TypeFunction) to))
-            return MATCH.nomatch;
```

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=21518

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to johanengelen from comment #1)
> This frontend change "fixes" the errors (3 lines removed):
> diff dmd/mtype.d:
> ```
>     /** Extends TypeNext.constConv by also checking for matching attributes
> **/
>     override MATCH constConv(Type to)
>     {
> -        // Attributes need to match exactly, otherwise it's an implicit
> conversion
> -        if (this.ty != to.ty || !this.attributesEqual(cast(TypeFunction)
> to))
> -            return MATCH.nomatch;
> ```
Those three lines come from https://github.com/dlang/dmd/pull/12090 which was first released in v2.096.0.  This conveniently fits your timeline, so is a possible introducer of the regression.

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=22186

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
FYI, `import std.traits;` can be replaced with

---
template fullyQualifiedName(T...)
{
    enum fullyQualifiedName = !T[0];
}
---

To remove all phobos dependencies.

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to johanengelen from comment #0)
>   void func_2(Dlg)(Dlg dlg) {
>     __trace_maybeDumpTupleToFile(dlg);
>   }
Just a suggestion, should this be `const Dlg` instead?

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

--- Comment #5 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Still 3 files, but one possible reduction.

space_reclaimer.d
```
void __trace_maybeDumpTupleToFile(Args)(ref const Args ) { }

auto as(Func)(Func) {}

@nogc void foo() { }

void assertOp(LHS)(LHS lhs) {
  as({
    try {
      try as(lhs);
      catch(Throwable) foo;
    } catch(Throwable) assert(false);
  });
}

struct FixedArray(T) {
  int a = !FixedArray;

  T* some_function() {
    assertOp(1);
    return null;
  }
  alias some_function this;
}

struct ReclamationBatch {

  FixedArray!(uint) dummy;

  @nogc nothrow void some_inout_func() { }

  void func_2(Dlg)(Dlg dlg) {
    __trace_maybeDumpTupleToFile(dlg);
  }

  void _reclaimBatch() {
    func_2({ some_inout_func; });
  }
}
```

tiering_policies.d
```
interface Timeline { }

struct Policy {
  alias OldTagCallback = void delegate() @nogc nothrow;
  Timeline timeline;
  OldTagCallback oldTagCB;
}

import static_hash;

struct Tiering {
    StaticHashTable!(Policy) policies;
}
```

static_hash.d
```
struct StaticHashTable(V) {
    V v;
}
```

------------------------------------
Bonus source file, a minimal object.d to also rule out druntime.
```
module object;

alias size_t = ulong;

class Object { }

class TypeInfo
{
    size_t getHash(const void* ) nothrow { }
}

class TypeInfo_Const : TypeInfo { }
class Throwable { }
bool _xopEquals() { }
```

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #14818 "fix Issue 23626 - [REG2.096] Template deduction with auto const ref Args... and delegate" fixing this issue:

- fix Issue 23626 - [REG2.096] Template deduction with auto const ref Args... and delegate

https://github.com/dlang/dmd/pull/14818

--
January 15, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14818 "fix Issue 23626 - [REG2.096] Template deduction with auto const ref Args... and delegate" was merged into stable:

- ca530908ce1ce07d52f0c90aaa5f3824cbc7816e by Iain Buclaw:
  fix Issue 23626 - [REG2.096] Template deduction with auto const ref Args...
and delegate

https://github.com/dlang/dmd/pull/14818

--
January 15, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

--- Comment #8 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14823 "merge stable" was merged into master:

- 815eb678c704470d190fc63579428d481bf55063 by Iain Buclaw:
  fix Issue 23626 - [REG2.096] Template deduction with auto const ref Args...
and delegate

https://github.com/dlang/dmd/pull/14823

--
January 16, 2023
https://issues.dlang.org/show_bug.cgi?id=23626

--- Comment #9 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14821 "follow-up Issue 23626 - invert trustSystemEqualsDefault initializer to true" was merged into master:

- c111eaedcdbe6b4a7da372e2b05cca1cbac4b677 by Iain Buclaw:
  follow-up Issue 23626 - invert trustSystemEqualsDefault initializer to true

  This is the desired behaviour for any future users of this function.

https://github.com/dlang/dmd/pull/14821

--