Unittest Absurdity

frame frame86 at live.com
Fri Aug 5 19:53:55 UTC 2022


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.

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.

Same for your example:
```d
foo!("hi", int)
{
	pure nothrow @nogc @safe void foo(int t)
	{
	}
}
```


More information about the Digitalmars-d-learn mailing list