Issue 659 - unclear error message
Summary: unclear error message
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: Walter Bright
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2006-12-06 16:37 UTC by Carlos Santander
Modified: 2015-06-09 05:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Carlos Santander 2006-12-06 16:37:53 UTC
This code gives an unclear error message:

//----------------
struct A
{
    int [10] arr;
}

void main ()
{
    A a;
    a.arr.length = 20;
}
//----------------
$ gdmd test.d 
test.d:9: Error: constant (*(&(a) + 0)).length is not an lvalue
//----------------
Comment 1 Unknown W. Brackets 2009-03-30 00:42:22 UTC
In DMD 1.041 and 2.026, the error message is now:

name.d(9): Error: constant a.arr.length is not an lvalue

Which is a must clearer, and more correct, error message.

-[Unknown]