Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed selective import (alias) don't work with eponymous template #18920

Open
dlangBugzillaToGithub opened this issue Dec 4, 2014 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

Martin Nowak (@MartinNowak) reported this on 2014-12-04T00:28:46Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=13814

Description

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()
@dlangBugzillaToGithub
Copy link
Author

code (@MartinNowak) commented on 2014-12-04T00:30:51Z

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant