[Issue 14883] New: static if does not work although an is expression produces 'true'
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Aug 7 00:51:43 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14883
Issue ID: 14883
Summary: static if does not work although an is expression
produces 'true'
Product: D
Version: D2
Hardware: x86_64
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: pastuhov85 at gmail.com
D 2.068.0-rc1
static if does not work although an is expression produces 'true'
import std.stdio;
auto foo(T)(T)
{
return 42;
}
struct Vector(T)
{
pragma(msg, is(typeof(foo(Vector.init)))); // prints true
static if(is(typeof(foo(Vector.init)))) {
static assert(false); // is not included
}
}
void main()
{
Vector!float v;
}
Related topic:
http://forum.dlang.org/thread/dlwevkweklswcfxykurg@forum.dlang.org
--
More information about the Digitalmars-d-bugs
mailing list