Bug 11458 – initialization of a custom type(using alias this) broken in dmd 2.064.2
Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-11-06T19:18:00Z
Last change time
2013-11-06T19:42:33Z
Assigned to
nobody
Creator
burg.basile
Comments
Comment #0 by burg.basile — 2013-11-06T19:18:09Z
regression from dmd 2.063.2 to 2.064.2, initialization of a custom type using alias this.
example:
--------
struct myType{int _field; alias _field this;}
struct myStruct
{
private:
myType dt;
public:
this (string param)
{
dt = 0;
}
}
void main(string[] args)
{
auto MyStruct = myStruct("broken");
}
outputs:
--------
file.d(11): Error: cannot implicitly convert expression (0) of type int to myType
other:
------
verified on Win x86, Linux X86_64.
Comment #1 by k.hara.pg — 2013-11-06T19:42:33Z
This is an intended language fix introduced by fixing bug 9665.
See also issue 11270 comments.
*** This issue has been marked as a duplicate of issue 11270 ***