http://d.puremagic.com/issues/show_bug.cgi?id=9912
Summary: Wrong codegen when using tuple over member variable in
more than one method
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Iain Buclaw <[email protected]> 2013-04-09 07:36:38 PDT ---
GDC bug report:
http://bugzilla.gdcproject.org/show_bug.cgi?id=49
LDC bug report:
https://github.com/ldc-developers/ldc/issues/266
Minimal testcase:
---
template Tuple(Stuff ...) {
alias Stuff Tuple;
}
struct S {
int i;
alias Tuple!i t;
void a() {
auto x = t;
}
void b() {
auto x = t;
}
}
---
Causes an ICE in gdc and ldc because the dotvar expression 'this.i' is cached
and re-used when building the tuple expression in both methods 'a' and 'b'.
Meaning that both uses of 'this' is given the parent context of method 'a'.
This is a problem when you try to access the 'this' parameter of 'a' from the
function 'b'... Oops, you can't do that!
Problem is in the D frontend, and should be fixed.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------