[Issue 15754] New: can access alias from instance but not from type
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Mar 4 05:27:01 PST 2016
https://issues.dlang.org/show_bug.cgi?id=15754
Issue ID: 15754
Summary: can access alias from instance but not from type
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: john.loughran.colvin at gmail.com
struct Capture(alias v)
{
alias a = v;
}
void main()
{
int a = 3;
foo(Capture!a());
}
void foo(C)(C c)
{
//f3.d(14): Error: function D main is a nested function and cannot be accessed
from f3.foo!(Capture!(a)).foo
// auto a = C.a;
// OK:
auto a = C().a;
}
For a start, the error message is seriously confusing (main is nested function?
Whut?).
--
More information about the Digitalmars-d-bugs
mailing list