[Issue 2210] Error: void initializer has no value
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jul 9 09:34:52 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2210
------- Comment #3 from 2korden at gmail.com 2008-07-09 11:34 -------
I'm sorry, I didn't investigate problem deep enough. Issue is completely
different.
Let's start with a bachground, first. The following template is used to work
prior to DMD1.032 release:
private template isStaticArrayTypeInst( T )
{
const T isStaticArrayTypeInst = void;
}
/**
* Evaluates to true if T is a static array type.
*/
template isStaticArrayType( T )
{
static if( is( typeof(T.length) ) && !is( typeof(T) == typeof(T.init) ) )
{
const bool isStaticArrayType = is( T ==
typeof(T[0])[isStaticArrayTypeInst!(T).length] );
}
else
{
const bool isStaticArrayType = false;
}
}
But now it doesn't. I reduced the test case to the following difference:
template Test( T ) {
const bool Test = ( is( typeof(T) == typeof(T.init) ) );
}
void main() {
static assert( Test!(int) );
}
This asserts succeeded in DMD1.031 and fails in DMD1.032. As you see, it's a
typeof(int) issue, that was discussed last days. That's it.
--
More information about the Digitalmars-d-bugs
mailing list