digitalmars.D.bugs - [Issue 19103] New: Can imports symbols in module to a struct with
- d-bugmail puremagic.com (39/39) Jul 19 2018 https://issues.dlang.org/show_bug.cgi?id=19103
https://issues.dlang.org/show_bug.cgi?id=19103 Issue ID: 19103 Summary: Can imports symbols in module to a struct with mixin. Product: D Version: D2 Hardware: All OS: Windows Status: NEW Severity: regression Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: kntroh gmail.com Mixing import statements in a struct. Then symbols in the module will be imported as a members of the struct. This bug seems to be from dmd 2.080.0 to current nightly build. --- void main() { //(new C).writeln("OK."); // Error: no property writeln for type test.C, did you mean std.stdio.writeln(T...)(T args)? S1 s1; s1.writeln("Hey?"); // It can be compiled and runs! S2 s2; //s2.writeln("OK."); // Error: no property writeln for type S2, did you mean std.stdio.writeln(T...)(T args)? } mixin template T() { import std.stdio; } class C { mixin T; } struct S1 { mixin T; } struct S2 { private import std.stdio; } --
Jul 19 2018