Jonathan M Davis (@jmdavis) reported this on 2013-09-15T14:54:15Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=11048
CC List
- Andrej Mitrovic (@AndrejMitrovic)
- Walter Bright (@WalterBright)
- Vladimir Panteleev (@CyberShadow)
- Iain Buclaw (@ibuclaw)
- Mathias LANG (@Geod24)
Description
int x = 7;
void foo() pure
{
// Does not detect use of mutable global and compiles when it shouldn't.
bar();
// Correctly detects the use of a mutable global and gives an error
baz(x);
}
void bar(int a = x) pure {}
void baz(int a) pure {}
void main() {}