[Issue 23417] New: Confusing error message when assigning non-existent struct field to the same name global variable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 15 20:57:58 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23417
Issue ID: 23417
Summary: Confusing error message when assigning non-existent
struct field to the same name global variable
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: skocznymr at gmail.com
struct Foo
{
int b;
}
int bar;
void main()
{
Foo f;
bar = f.bar;
}
Example code to reproduce the issue. Error message is: "Failure with output:
onlineapp.d(11): Error: function expected before `()`, not `bar` of type `int`"
Potential regression in 2.063
Up to 2.062 : Failure with output: onlineapp.d(11): Error: no property
'bar' for type 'Foo', did you mean 'b'?
2.063 to 2.078.3: Failure with output: onlineapp.d(11): Error: function
expected before (), not bar of type int
Since 2.079.1: Failure with output: onlineapp.d(11): Error: function
expected before `()`, not `bar` of type `int`
--
More information about the Digitalmars-d-bugs
mailing list