-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
naming conflict #40
Comments
Hi Wichert, AFAIK all local variables that Catch uses have fairly obfuscated names (for exactly this reason) - usually including a catch based prefix and line number too. Obviously if I've missed any I'd like to know about it (and fix it). Could you try and boil your case down to the smallest thing that demonstrates the problem and post it here. Thanks for the feedback. |
Actually I just had a feeling I might know where the variable you're talking about might be. Had a quick look and, sure enough, there it is. It's in a scope entirely controlled by Catch, so technically it is safe. I'll push a fix up later today. Thanks again for letting me know. |
I checked in that change. There were actually three undecorated names that I found (incuding 'action'). All should have been safely within inner-scopes - but at least for the sake of warnings I've now prefixed them. |
I'll try later this week. A somewhat related question: when moving to Wichert Akkerman wichert@wiggy.net It is simple to make things. |
The docs need an overhaul + extending (the latter being the main reason for the former!). |
Hi @wichert - have you had a chance to verify this fix (and the docs)? |
I'm going to close this issue for now as my own view is that the issue is resolved. If you see any other name clashes please reopen (is that even possible with GitHub's system?) or just log a new issue. Thanks again for reporting it. |
Catch appears to be using local variables with very obvious names, making it likely to get conflicts. I ran into this in a test which has a local variable called
action
. This resulted in the compiler producingwarning: declaration of ‘action’ shadows a previous local
, and indeed my tests were failing as well.I would suggest to use a prefix for any variables injected by Catch that is not likely to conflict. Perhaps something as simple as
_catch_
?The text was updated successfully, but these errors were encountered: