Bug 969 – 'this' needed for class member

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-02-16T12:04:00Z
Last change time
2014-02-16T15:22:38Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
samukha

Comments

Comment #0 by samukha — 2007-02-16T12:04:57Z
The compiler chokes on the code below with the error: need 'this' to access member a'. Should it? template TFoo(alias T) { void foo() { writefln(T); } } template TBar(alias T) { void bar() { TFoo!(T).foo(); } } class Test { int a; mixin TBar!(a); } void main() { }
Comment #1 by thomas-dloop — 2007-02-26T05:26:23Z
One variation of the issue results in: template.c:2853: TemplateDeclaration* TemplateInstance::findTemplateDeclaration(Scope*): Assertion `s->parent' failed. Added to DStress as http://dstress.kuehne.cn/run/b/bug_template_2851_A.d http://dstress.kuehne.cn/run/b/bug_template_2851_B.d http://dstress.kuehne.cn/run/b/bug_template_2851_C.d
Comment #2 by bugzilla — 2007-08-12T22:30:46Z
Works fine with DMD 1.021 / 2.003 P.S. When you say "one variation", please let me know which one. This is especially helpful when I cannot reproduce the problem.