D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13814 - renamed selective import (alias) don't work with eponymous template
Summary: renamed selective import (alias) don't work with eponymous template
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-04 00:28 UTC by Martin Nowak
Modified: 2024-12-13 18:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2014-12-04 00:28:46 UTC
cat > bug.d << CODE
module bug;

void func(string) {}

template ng()
{
    // renamed selective import isn't a "real" alias
    import bug : ng = func;
}

template ok()
{
    import bug : func;
    // real alias works
    alias ok = func;
}

void test()
{
    ok("works");
    ng("doesn't work");
}
CODE

dmd -c bug
----
bug.d(21): Error: template bug.ng cannot deduce function from argument types !()(string), candidates are:
bug.d(5):        bug.ng()
Comment 1 Martin Nowak 2014-12-04 00:30:51 UTC
Selective imports that aren't renamed don't work either.

cat > bug.d << CODE
template format()
{
    import std.string : format;
}

void test()
{
    format("");
}
CODE

dmd -c bug.d
Comment 2 dlangBugzillaToGithub 2024-12-13 18:38:02 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18920

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB