https://issues.dlang.org/show_bug.cgi?id=12570
Issue ID: 12570
Summary: cast to template interface
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
Consider this code:
////////////////////////////////
import std.stdio;
interface A {}
interface B(T : A) : A {}
class C_a : A {}
class B_a : B!C_a {}
void main()
{
B_a b = new B_a;
B!A b_a = b;
writeln(b_a);
}
////////////////////////////////
Compiler says:
Error: cannot implicitly convert expression (b) of type B_a to B!(A).B
Shouldn't it be allowed?
However, explicit cast result in null.
--