```d
interface I {
        bool check();
}
class A : I {
        bool check() =>true;
}
class B : I {
        bool check() =>false;
}

I aOrB(bool check) => check ? new A() : new B();

void main()
{
  assert( aOrB(true).check );
}
```

Compiler error:

```d
x.d(11): Error: cannot implicitly convert expression `check ? new A : new B` of type `object.Object` to `x.I`
```

Basically, the ternary conditional ```?:``` result type is not inferred even if the type returned by the two possibilities are the same.

**Is it a bug or the expected behaviour?**

Reply via email to