On Friday, 5 August 2022 at 02:20:31 UTC, Steven Schveighoffer wrote:
On 8/4/22 9:51 PM, Paul Backus wrote:
Another option: use -vcg-ast, and have the compiler tell you what it's actually calling. It's not ignoring that line, it's just not doing what you think it's doing.

The output's not that useful...

```d
import object;
struct S
{
        int n;
        void opOpAssign(string op)(S rhs) if (op == "/=")
        {
                n++;
        }
        void opOpAssign(string op)(S rhs) if (op == "/")
        {
        }
}
unittest
{
        S a = S(1);
        S b = S(2);
        a.opOpAssign(b);
        b.opOpAssign(a);
        assert(a.n == 2);
        assert(b.n == 3);
}
...
```

With this tiny example code it's clear by the end when there's only this one template instantiation:

```d
opOpAssign!"/"
{
        pure nothrow @nogc @safe void opOpAssign(S rhs)
        {
        }

}
```
  • Unittest Absurdity Ruby The Roobster via Digitalmars-d-learn
    • Re: Unittest Absurdity Ruby The Roobster via Digitalmars-d-learn
      • Re: Unittest Absurdi... jfondren via Digitalmars-d-learn
        • Re: Unittest Abs... jfondren via Digitalmars-d-learn
          • Re: Unittest... Ruby The Roobster via Digitalmars-d-learn
            • Re: Uni... Ruby The Roobster via Digitalmars-d-learn
              • Re:... Ruby The Roobster via Digitalmars-d-learn
                • ... jfondren via Digitalmars-d-learn
            • Re: Uni... Paul Backus via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
                • ... jfondren via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... frame via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... frame via Digitalmars-d-learn

Reply via email to