Bug 14320 – Improve diagnostic message for "undefined identifier" error
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-23T08:42:00Z
Last change time
2017-07-02T17:13:20Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2015-03-23T08:42:39Z
-- gui/widgget.d -----
module gui.widget;
class Style {} // originally existed in gui.style
class Widget
{
Style style() {}
void layoutChildren(bool fit, Widget positionReference) {}
}
----
-- controls/tree.d ---
module controls.tree;
import gui.widget;
class Tree : Widget
{
override void layoutChildren(bool fit, Widget positionReference)
{
gui.style.Style st = style; // line 9
}
}
----
The error diagnostic is:
controls/tree.d(9): Error: undefined identifier 'style'
It actually explains the unexistent of module 'gui.style' in package 'gui', but it sounds like the explanation for the invisibility of Widget.style() function.
I think it should be improved as follows:
controls/tree.d(9): Error: undefined identifier 'gui.style' in package 'gui'