# Bug Fix

This topic is 4080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Bug with register methods Problem with registering functions as 'void func(void)'. AngelScript seems to treat this as a function with one parameter, thus not resolving calls to this function. I fixed this bug, I'm not sure if it's the way you'd do it, but this now works properly. Starting at line 593:
                if( type.GetTokenType() != ttVoid )
{
// Store the parameter type
func->parameterTypes.PushLast(type);
func->inOutFlags.PushLast(inOutFlags);

if( autoHandle && (!type.IsObjectHandle() || type.IsReference()) )
return asINVALID_DECLARATION;

if( paramAutoHandles ) paramAutoHandles->PushLast(autoHandle);

}

// Move to next parameter
n = n->next->next;
if( n && n->nodeType == snIdentifier )
n = n->next;


I've only been looking through your code for about 30 minutes, so I'm not sure if this will break other things down the line. Jeremy

##### Share on other sites
Also I'm assuming this bug would be in other places such as registering class methods. So obviously there has to be a better place to do this (assuming in the parser). But since I don't have a very good knowledge of your code, I'm having trouble finding where this should actually be fixed at.

##### Share on other sites
Thanks for the fix. It looks to be correct.

I'll verify if this needs to be added to other places as well.

Regards,
Andreas

• 38
• 15
• 9
• 23
• 10