On 8/5/22 3:53 PM, frame wrote:
On Friday, 5 August 2022 at 15:24:16 UTC, Steven Schveighoffer wrote:

oof, I expected this to include the template parameters! I believe it normally does?
This is a bug that should be filed.

-Steve

Sorry, I don't get what you takling about?

The docs says:

The expression:
`a op= b`

is rewritten as:
`a.opOpAssign!("op")(b)`

There must no "=" to be applied.

That's not what I was talking about here. I'm talking about `-vcg-ast` not telling you how it's calling the function.


The compiler creates this:
```d
opOpAssign!"/"
{
     pure nothrow @nogc @safe void opOpAssign(S rhs)
     {
     }
}
```
as only valid call left. Fine for me since the other template is unused.

And what if the other template is used?

This is the AST from code that instantiates foo twice, and calls it 3 times. Tell me which calls are which?

```d
import object;
void foo(string s, T)(T t)
{
}
void main()
{
        foo(1);
        foo(1);
        foo(1);
        return 0;
}
mixin _d_cmain!(); // omitted for brevity
foo!("hi", int)
{
        pure nothrow @nogc @safe void foo(int t)
        {
        }

}
foo!("bar", int)
{
        pure nothrow @nogc @safe void foo(int t)
        {
        }

}
```

-Steve

Reply via email to