Bug 2440 – VarDeclaration::toSymbol(): Assertion `!needThis()' failed

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2008-11-03T16:01:00Z
Last change time
2015-06-09T01:20:18Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
jlquinn

Attachments

IDFilenameSummaryContent-TypeSize
278bug1.dSource file causing failuretext/x-dsrc302

Comments

Comment #0 by jlquinn — 2008-11-03T16:01:52Z
-*- mode: compilation; default-directory: "~/d/" -*- Compilation started at Mon Nov 3 17:01:29 ~/dmd/bin/dmd -c bug1.d dmd: tocsym.c:166: virtual Symbol* VarDeclaration::toSymbol(): Assertion `!needThis()' failed. Compilation aborted at Mon Nov 3 17:01:29
Comment #1 by jlquinn — 2008-11-03T16:02:41Z
Created attachment 278 Source file causing failure
Comment #2 by smjg — 2008-11-24T11:08:44Z
A slightly reduced testcase: ---------- struct R { this(int i, int j) { from = i, to = j; } int from = -1; int to = -2; } class B { const void bar(in R r = R(0, -1)) {} } class M { B b; void foo() { b.bar(); } } class M { B b; void foo() { b.bar(); } } ---------- Assertion failure: '!needThis()' on line 166 in file 'tocsym.c' abnormal program termination ----------
Comment #3 by clugdbug — 2009-05-04T07:50:05Z
*** This bug has been marked as a duplicate of 2437 ***