October 30, 2020 [Issue 21351] New: When struct A is imported inside struct B, with(B) gets passed to A() constructor. | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21351 Issue ID: 21351 Summary: When struct A is imported inside struct B, with(B) gets passed to A() constructor. Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: default_357-line@yahoo.de Consider these three files: --- a.d struct A { int value; } --- b.d struct B { import a : A; } --- test.d void main() { with (B()) A(0); } DMD will say: test.d(5): Error: cannot implicitly convert expression __withSym of type B* to int Despite B() not being necessary or allowed for A(). -- |
Copyright © 1999-2021 by the D Language Foundation