On 8/4/16 11:19 AM, Andre Pany wrote:
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?

Ah, it's an interface. I thought it was a base class.

This is expected, no need to open a request.

-Steve

Reply via email to