Bug 908 – compiler dies trying to inline static method call to nonstatic method in template code.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-01-30T23:50:00Z
Last change time
2014-02-16T15:22:28Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
kevinbealer

Comments

Comment #0 by kevinbealer — 2007-01-30T23:50:49Z
dmd -ofsimple -release -inline -O simple.d dmd: inline.c:473: virtual Expression* ThisExp::doInline(InlineDoState*): Assertion `ids->vthis' failed. make: *** [toplvl] Aborted I think almost all of this syntax is necessary. The basic rule seems to be: If you: - Use a class from more than one place. - Define a nonempty nonvirtual function. - Use incorrect 'static' syntax - the line marked //OOPS here - The //OOPS must be from a template. (This is on Linux.) Thanks, Kevin // simple.d----- class Quux { uint x; final uint next () { return x; } } template Foo(T) { void bar() { int r = Quux.next; } } int main(char[][] args) { auto prng = new Quux(); alias Foo!(int).bar baz; int x = prng.next; baz(); return 0; }
Comment #1 by bugzilla — 2007-02-12T03:45:01Z
Fixed DMD 1.005
Comment #2 by thomas-dloop — 2007-02-15T03:43:09Z