mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
20 lines
314 B
D
20 lines
314 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail284.d(19): Error: `pure` function `fail284.foo` cannot call impure function pointer `a`
|
|
---
|
|
*/
|
|
|
|
static int nasty;
|
|
|
|
int impure_evil_function(int x)
|
|
{
|
|
nasty++;
|
|
return nasty;
|
|
}
|
|
|
|
pure int foo(int x)
|
|
{
|
|
int function(int) a = &impure_evil_function;
|
|
return a(x);
|
|
}
|