Jump to content
  • Advertisement
Sign in to follow this  

switch return bug

This topic is 2341 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
[source lang="cpp"] bool onEvent()
case 1:
return true;
return false;

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
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.


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!