Bug 4982 – Repeating same error message thousands of times due to brute forcing matching symbol name

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2010-10-02T21:37:00Z
Last change time
2015-06-09T05:12:02Z
Keywords
diagnostic, rejects-valid
Assigned to
nobody
Creator
2korden
Blocks
340

Comments

Comment #0 by 2korden — 2010-10-02T21:37:35Z
class A { Foo foo; // int someSymbol; } class B : A { } alias typeof(&B.init.someSymbol) Foo; Result: test.d(6): Error: class test.B is forward referenced when looking for 'someSymboKl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboLl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboMl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboNl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboOl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboPl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboQl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboRl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboSl' test.d(6): Error: class test.B is forward referenced when looking for 'someSymboTl' ...
Comment #1 by smjg — 2010-10-04T06:02:35Z
The error message is bogus in any case. Should be something like test.d(11): no property 'someSymbol' for type 'B' Though not technically an ICE, it seems to run into an infinite loop, effectively hanging the compiler, hence my adding ice-on-invalid-code.
Comment #2 by 2korden — 2010-10-04T11:59:44Z
With "int someSymbol;" uncommented code becomes valid, isn't it?
Comment #3 by smjg — 2010-10-05T09:56:50Z
Well, obviously, but that isn't part of the bug being reported. But I've just found that the same happens with it in. And I've just had a closer look at the output, and realise it's the spellcheck facility seeing if there's something closely resembling the symbol it thinks is undefined. So the loop isn't infinite. Though DMD's notion of closely resembling puzzles me: if I reduce the name to "s" then it tries a total of 16130 of them.
Comment #4 by yebblies — 2011-06-15T09:03:24Z
This works in current dmd (1.068 & 2.053)