www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Two bugs, don't know how to title them

First "is(typeof(a) == function)" is not recognized to be true
Second, because of the "d" template, I get "Assertion failure: '0' on line 734
in file 'glue.c'"

This is in both DMD 1.025/1.027

-------------------------------------------------------------

import tango.core.Traits;

typeof(func) f(func)()
{
	return function (ParameterTupleOf!(func))
	{
		int a;
		a++;
	};
}

typeof(func) d(func)()
{
	return delegate (ParameterTupleOf!(func))
	{
		int a;
		a++;
	};
}

void main()
{
	void function(char[]) a;
	void delegate(char[]) b;

	if(is(typeof(a) == function))
	{
		assert(false,"a");
		a=f!(typeof(a));
	}
	if(is(typeof(b) == delegate))
	{
		assert(false,"b");
		b=d!(typeof(b));
	}
}
Feb 23 2008