I find the behavior of the following code unexpected. bool foo(alias f)() { return is(typeof(f) == int); } unittest { { int a; static assert(foo!a); } { float a; static assert(foo!a); // passes unexpectedly } } The second assert passes unexpectedly. If you change the variable name to b it fails as expected. Bug or not so unexpected behavior? To me it's a bug. But maybe there is a explanation that I'm not aware of. The same behavior is observed when foo is defined as a template. This is dmd v2.066.0 on Linux.
it's definetely a bug. there is no sane explanation why both tests using 'int a' here.
This has the same cause as issue 12244 and issue 3031 - function-local symbols do not have unique names and conflict with symbols in sibling scopes.
*** Issue 15527 has been marked as a duplicate of this issue. ***
*** This issue has been marked as a duplicate of issue 11521 ***