``` import std; class AClass { T opCall(T)(T p) { return p; } } void main(){ Array!AClass arr; } ``` compiles with error ``` ... phobos/std/conv.d(4434): Error: need this for opCall of type pure nothrow @nogc @safe AClass(AClass p) ``` The reason is that in std.conv.emplaceRef ``` static if (is(typeof(chunk = T(args)))) chunk = T(args); ``` `is(typeof(chunk = T(args)))` return true but the expression `chunk = T(args);` do not compiles nevertheless.
https://github.com/dlang/phobos/pull/7398
@drug007 updated dlang/phobos pull request #7398 "Fix issue 20589 - typeof may give wrong result in case of classes defining `opCall` operator" mentioning this issue: - Test for issue 20589 https://github.com/dlang/phobos/pull/7398
dlang/phobos pull request #7398 "Fix issue 20589 - typeof may give wrong result in case of classes defining `opCall` operator" was merged into master: - 7ffdfef3f75d521cc7b0b2659e438f501f263ca1 by drug007: Fix issue 20589 - typeof may give wrong result in case of classes defining `opCall` operator - e4959d4777be74a426aa6d8c58abc5308a62b92b by drug007: Test for issue 20589 https://github.com/dlang/phobos/pull/7398