1738 – Error on struct without line number

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1738 - Error on struct without line number
Summary: Error on struct without line number
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL: http://www.digitalmars.com/webnews/ne...
Keywords: diagnostic
Depends on:
Blocks:
Reported: 2007年12月17日 12:25 UTC by Justin C Calvarese
Modified: 2014年02月24日 15:33 UTC (History)
0 users

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 Justin C Calvarese 2007年12月17日 12:25:16 UTC
I narrowed down the error without a line number that Dan saw in Walnut. I don't know that DMD is reject code that is invalid in Dan's case, but obviously the code in my reduced example is invalid code. The error message should be improved to show where the error occurs.
Example:
<code>
struct MyStruct {
}
static const MyStruct
	FALSE = { b:false };
</code>
Error Message:
Error: 'b' is not a member of 'MyStruct'
(no line number provided by DMD)
Comment 1 Justin C Calvarese 2007年12月17日 12:27:10 UTC
I fixed the summary.
Comment 2 Dan Lewis 2008年01月01日 00:56:08 UTC
Umm... well, this issue is blocking any development on my program with any compiler after 1.020 (whatever changed, happened in 1.021)
My code shows:
struct Value {
 union {
 bool b;
 int i;
 ...
 }
}
static const Value
 UNDEFINED = ...
 FALSE = { b:false ... }
 ...
I get an error message which is completely not useful. It just says "b is not a member of Value"; which it clearly is.
Please help.
Regards,
Dan
Comment 3 Justin C Calvarese 2008年01月02日 10:23:50 UTC
DMD 1.025 seems to have fixed the missing line number bug. My test case now yields a filename and line number:
<quote>
test1.d(14): Error: 'b' is not a member of 'MyStruct'
</quote>
It also may have fixed Dan's code since this snippet now compiles, too:
<code>
struct Value {
 union {
 bool b;
 int i;
 }
}
static const Value
 FALSE = { b:false};
</code>
(But I think that snippet seemed to compile with DMD 1.024, too.)
Dan, if you continue to have related problems, you should probably post a new bug report with a new description, test case, etc., since the description and keyword of this bug report doesn't apply anymore since the line number is provided for invalid code.


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