www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16160] New: selective imports in aggregation shadow property


          Issue ID: 16160
           Summary: selective imports in aggregation shadow  property
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: rburners gmail.com

struct Foo {
    import std.array : empty;

     property bool empty() {
        return true;

unittest {
    Foo f;

Error: expression f.empty of type void does not have a boolean value
It seams like the import of std.array.empty is shadowing the empty  property.
Moving the import out of the struct fixes the problem.

Jun 10 2016