D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19162 - [REG: 2.079.0] Public Import Overlapping Names Conflict Resolution
Summary: [REG: 2.079.0] Public Import Overlapping Names Conflict Resolution
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2018-08-13 03:20 UTC by jacob
Modified: 2018-08-21 11:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jacob 2018-08-13 03:20:24 UTC
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;
}

*******************************************************
Comment 1 Seb 2018-08-15 23:25:51 UTC
Please don't forget to mention a PR if you submitted it, s.t. other people know about this when browsing the issue list.
In this case it's:

https://github.com/dlang/phobos/pull/6664

Thanks!
Comment 2 github-bugzilla 2018-08-21 11:27:35 UTC
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/1798119abff6b7226ad65ce57339a26f0ab0bf4e
Fix issue 19162

https://github.com/dlang/phobos/commit/dc2c899e16a8e15b55ce63c3b260efc6a5cb1eaf
Merge pull request #6664 from look-at-me/master

Fix issue 19162 - [REG: 2.079.0] Public Import Overlapping Names Conflict Resolution
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>