[Issue 19162] New: [REG: 2.079.0] Public Import Overlapping Names Conflict Resolution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 13 03:20:24 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19162

          Issue ID: 19162
           Summary: [REG: 2.079.0] Public Import Overlapping Names
                    Conflict Resolution
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: look.at.me.pee.please at gmail.com

The following works in 2.078.1 but stopped working in 2.079.0. Seems to be
selecting std.math.abs instead of vec.abs which are both publicly imported in
module 'math'.


/../phobos\std\math.d(564): Error: incompatible types for `(x) >= (0)`:
`Vector!(float, 3)` and `int`
/../phobos\std\math.d(564): Error: `x` is not of arithmetic type, it is a
`Vector!(float, 3)`
\test\main.d(9): Error: template instance `std.math.abs!(Vector!(float, 3))`
error instantiating


*******************************************************

// main.d
import math;


void main()
{
    Vector!(float, 3) v;

    auto t = abs(v);
}

*******************************************************

// vec.d
module vec;


struct Vector(T, int size)
{
    T x, y, z;
}

auto abs(T, int size)(auto ref const Vector!(T, size) v)
{
    return v;
}


*******************************************************

// math.d
module math;

public
{
    import std.math; // order doesn't change error
    import vec;
}

*******************************************************

--


More information about the Digitalmars-d-bugs mailing list