Bug 6699 – More cases of __error in error messages
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-09-20T05:07:00Z
Last change time
2015-06-09T05:10:44Z
Keywords
diagnostic
Assigned to
clugdbug
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2011-09-20T05:07:38Z
From the test suite fail_compilation:
fail8, fail72, fail123 have bad error messages with __error.
fail10 has duplicated error msg
fail14 has an error with no line number
Comment #1 by clugdbug — 2011-09-21T04:00:25Z
From the test suite, fail228.d
int ToTypeString (T:int) ()
{
return 1;
}
int ToTypeString (T:string) ()
{
return 2;
}
static assert(ToTypeString!(localVariable)());
-------------------
fail228.d(12): Error: undefined identifier localVariable
fail228.d(12): Error: template fail228.ToTypeString(T : int) does not match any
function template declaration
fail228.d(12): Error: template fail228.ToTypeString(T : int) cannot deduce templ
ate function from argument types !(_error_)()
fail228.d(12): Error: template instance ToTypeString!(_error_) errors instantiat
ing template
Comment #2 by clugdbug — 2012-02-08T13:42:36Z
I created new bugs (bug 7465 and bug 7466) for the fail10 and fail14 cases.
Apart from the bug in comment1, which I will call case A, the other known instances of _error are:
// CASE B: from bug 6475 (and many other places)
alias int b6699;
alias b6699.x b6699a;
crash.d(2): Error: no property 'x' for type 'int'
crash.d(2): Error: alias crash.b6699a cannot alias an expression __error
// CASE C: from fail72
void bug6699()
{
synchronized( foo ) { }
}
crash.d(3): Error: undefined identifier foo
crash.d(3): Error: can only synchronize on class objects, not '_error_'
// CASE D: from fail8 and fail123.
struct Foo6699 { int x; }
enum Bar6699 : Foo6699 { a, b }
crash.d(3): Error: cannot implicitly convert expression (0) of type int to Foo66
99
Error: no property 'max' for type 'Foo6699'
crash.d(3): Error: Integer constant expression expected instead of (__error) ==
(__error)
See also bug 7462, bug 5302, and bug 6796, which also have _error.
Comment #3 by clugdbug — 2012-02-09T14:05:09Z
I have moved case D into a new bug 7477, since it involves more thought (it isn't a simple error message issue).
I also add case E, which contains 3 more __error bugs:
class X : junk, junk2 {}
interface X2 : junk3 {}
crash.d(1): Error: undefined identifier junk
crash.d(1): Error: undefined identifier junk2
crash.d(1): Error: class crash.X base type must be class or interface, not _error_
crash.d(1): Error: class crash.X base type must be interface, not _error_
crash.d(2): Error: undefined identifier junk3
crash.d(2): Error: interface crash.X2 base type must be interface, not _error_