On Tuesday, 2 February 2016 at 10:58:35 UTC, Marc Schütz wrote:
The constraint that fails is the one with `CommonType`:
`CommonType` uses the `?:` operator to derive the common type:
I filed a bug report:
https://issues.dlang.org/show_bug.cgi?id=15638
Interesting reduced case, so it wasn't cha
On Tuesday, 2 February 2016 at 09:51:52 UTC, Marc Schütz wrote:
The constraint that fails is the one with `CommonType`:
pragma(msg, CommonType!(const(B), const(C))); // void
`CommonType` uses the `?:` operator to derive the common type:
writeln(true ? b : c);
// Error: incompatible
The constraint that fails is the one with `CommonType`:
pragma(msg, CommonType!(const(B), const(C))); // void
`CommonType` uses the `?:` operator to derive the common type:
writeln(true ? b : c);
// Error: incompatible types for ((b) : (c)): 'const(B[])'
and 'const(C[])'
write
Sorry for late reply -- but I got around to test a couple more
cases!
On Monday, 1 February 2016 at 00:19:44 UTC, Nicholas Wilson wrote:
Unqaul means remove any const or immutable torn the type
Okay, that sounds like our 'const' shouldn't matter. 'const' is
the outermost qualifier, and strip
On Sunday, 31 January 2016 at 21:22:06 UTC, SimonN wrote:
Hi,
we start with the following code snippet, which works.
import std.algorithm;
import std.range;
import std.stdio;
class A { int val; }
class B : A { this() { val = 3; } }
class C : A { this() { val = 4; }
Hi,
we start with the following code snippet, which works.
import std.algorithm;
import std.range;
import std.stdio;
class A { int val; }
class B : A { this() { val = 3; } }
class C : A { this() { val = 4; } }
B[] b = [new B(), new B()];
C[] c = [new C(), ne