-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'popScope' has different behaivior on develop / release build. #152
Comments
That is correct. But that's the idea of asserts in general. Do you see it as an error situation that could happen in release that wouldn't be a fatal error that should have been detected during development? |
I just run in one of that situation mention in issue #153. I was relying on the thrown exception not realising that is was thrown by an assertion. It took me a day to find the bug. Is there any reason why not just prevent to pop the baseScope anyway? |
yes, IMHO if that happens something is wrong with your App, so it's better to have an assert. |
Ok, let's assume something is wrong in my app. Still would it not be nice if GetIt would prevent the User, in that case, the developer to make so silly mistake as I did? So that the end user gets a better experience. And print a warning or event throw an exception? So we get both, a happy end-user and GetIt can show to the developer he has done something properly wrong. |
I'm a big fan of ailing fast :-) But I agree we could change this into an if with an exception instead of the assert, so that you get a meaningful error message |
Implemented in V6.1.0 |
I do not know if its intentional or not. The assertion gets removed/disabled during the release build. Which can lead to strange behaviour without any meaningful error message. Or just not to pop if you are on the baseScope
The text was updated successfully, but these errors were encountered: