2012-10-29 48 views
5

我在镖实现状态机,我想有我状态函数返回其他国家职能,但怎样的typedef返回相同类型的其他功能的功能?

typedef State State(foo); 

给我一个错误:

typedef 'State' illegally refers to itself 

有什么方法来做这个typedef?很显然,我可以把它包在一个类或使其返回Function,但我希望用typedef做到这一点。

回答

3

对不起,这不是在规范中现在允许的。你可以打开在http://dartbug.com/new

功能要求使用对象或返回功能,你提到,将是现在去的最佳途径。