Jump to content
  • Advertisement
Sign in to follow this  
zerochen

switch return bug

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i think i found a bug with a switch and return statements
asscript:
[source lang="cpp"] bool onEvent()
{
switch(1)
{
case 1:
return true;
default:
return false;
}
}[/source]

error:
objects/Controller.as (54, 2) : INFO : Compiling bool Controller::onEvent()
objects/Controller.as (55, 2) : ERR : Not all paths return a value

but that isnt true. maybe return statements are not supported in switch cases. if so this is a feature request:)

thx Edited by Andreas Jonsson

Share this post


Link to post
Share on other sites
Advertisement
The switch statement currently doesn't have the logic to check if all possible paths have a return statement. I'll look into implementing it.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!