Bug 3159 – Can't access member variables from templated nested member function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-07-09T10:28:00Z
Last change time
2015-06-09T01:28:05Z
Keywords
rejects-valid
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2009-07-09T10:28:19Z
struct Foo {
uint number;
void doStuff(uint num) {
void doMoreStuff(T)(T num2) {
number++;
}
doMoreStuff(num);
}
}
test.d(7): Error: need 'this' to access member number
Also happens if Foo is a class instead of a struct. Does not happen if doMoreStuff() is a plain old function instead of a function template.