On Thursday, 4 August 2016 at 13:48:46 UTC, Steven Schveighoffer
wrote:
On 8/3/16 2:34 PM, Ali Çehreli wrote:
void main() {
Element[] elements = cast(Element[])[
quadraticCoefficient(1),
linearCoefficient(2), equals(), constant(1) ];
is the cast necessary? I assumed the compiler would infer the
common base type...
-Steve
I just tested it. The compiler cannot infer interface Element.
By changing the type from interface to class the compiler
is happy without the cast.
Does it worth to open an enhancement request for this specific
issue?
Kind regards
André