6699 – More cases of __error in error messages

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6699 - More cases of __error in error messages
Summary: More cases of __error in error messages
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: Don
URL:
Keywords: diagnostic
Depends on:
Blocks:
Reported: 2011年09月20日 05:07 UTC by Don
Modified: 2015年06月09日 05:10 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2011年09月20日 05:07:38 UTC
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 Don 2011年09月21日 04:00:25 UTC
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 Don 2012年02月08日 13:42:36 UTC
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 Don 2012年02月09日 14:05:09 UTC
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_
Comment 4 Walter Bright 2012年02月17日 23:06:22 UTC
https://github.com/D-Programming-Language/dmd/pull/704 
Comment 6 Kenji Hara 2014年08月10日 10:40:23 UTC
(In reply to Don from comment #0)
> From the test suite fail_compilation:
> 
> fail10 has duplicated error msg
It's fixed in 2.066-rc1.
Comment 7 github-bugzilla 2014年08月10日 12:54:39 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/def6905786701bbfe647f09ced0e30f772f5d1c1
fix Issue 6699 - More cases of __error in error messages


AltStyle によって変換されたページ (->オリジナル) /