funcdef error

Started by
1 comment, last by WitchLord 9 years, 6 months ago

The following script tested in 2.29.1 and earlier versions:


class foo {}
funcdef void bar(array<foo>);

results in following errors:


array (0, 0) : ERR : The subtype has no default factory
filename.as (2, 24) : ERR : Can't instantiate template 'array' with subtype 'foo'

These errors occur for every funcdef declaration that contains an array with a script-declared class subtype either as a parameter or a return value. Contents of the class don't matter, including whether the class contains an explicitly stated default constructor or not. The error information is certainly incorrect as this kind of an array can be instantiated anywhere outside of the funcdef declaration.

Advertisement

This is a tricky situation. The problem is that the array template type is being instantiated before the class foo has been fully evaluated.

I'll have to implement a way to defer the validations of the template types until all the types have been fully evaluated.

Thanks for reporting the problem.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've finally fixed this in revision 2030.

Thanks,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement