January 18, 2021 [Issue 21554] New: Invalid assignment expression yields valid type in is(typeof)-expression | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21554 Issue ID: 21554 Summary: Invalid assignment expression yields valid type in is(typeof)-expression Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: kinke@gmx.net class MyClass { T opCall(T)(T p) { return p; } } void emplaceRef(T, Args...)(ref T chunk, auto ref Args args) { static assert(!__traits(compiles, chunk = T(args))); // the following fails: `!is(MyClass)` is false static assert(!is(typeof(chunk = T(args)))); } int foo() { MyClass c; emplaceRef(c, new MyClass); } -- |
Copyright © 1999-2021 by the D Language Foundation