[Issue 12318] New: Nested structs with only templated methods do not capture context
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 8 11:07:25 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12318
Summary: Nested structs with only templated methods do not
capture context
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: minor
Priority: P3
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: thecybershadow at gmail.com
--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-03-08 21:07:23 EET ---
////////// test.d /////////
void a(int i)
{
struct S
{
// Uncomment to fix
//void dummy() {}
void b()()
{
assert(i);
}
}
S s;
s.b();
c(s);
}
void c(S)(S s)
{
s.b();
}
///////////////////////////
Compiler output:
test.d(10): Error: function test.a.S.b!().b cannot access frame of function
test.a
test.d(15): Error: template instance test.a.S.b!() error instantiating
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list