https://issues.dlang.org/show_bug.cgi?id=15945
Issue ID: 15945
Summary: sizeof on an invalid type seems to compile.
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
size_t foo(T)()
{
return T[0].sizeof;
}
void main()
{
auto a = foo!(ubyte[])();
assert(a == 1);
}
Seems like either that shouldn't compile, or (maybe?) the assert should pass.
Currently, it compiles and the assert fails.
--
