mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

* Fix issue 20369 - shadowed variable in foreach loop always considered "foreach variable" * Remove unintuitive phrase in deprecation message * Fix deprecation message in test * Add original variable's line information in deprecation (error) message
15 lines
320 B
D
15 lines
320 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail93.d(14): Error: variable `i` is shadowing variable `fail93.main.i`
|
|
fail_compilation/fail93.d(13): declared here
|
|
---
|
|
*/
|
|
|
|
// accepts-valid with DMD0.120. volatile as well as synchronized
|
|
|
|
void main()
|
|
{
|
|
int i = 1;
|
|
synchronized int i = 2; // should fail to compile
|
|
}
|