-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Possible latedef regression #2628
Comments
I agree it is a common pattern that needs a fix. The easy fix is just to move the binding in the var statement before running through the value. A better fix would be to add it with a flag that it is as yet undeclared for use in this function e.g.
which would make it match |
I'm also a bit strapped for time. If/when you are able to get to this, self-assign this issue (I'll do the same). I know we talked about releasing soon, but I'm happy to wait as long as it takes, so don't feel pressured! |
The regression was introduced in 6d2cc19 |
@lukeapage The following code issues a warning on
master
(but not v2.8.0):Although we can't statically differentiate patterns like that from patterns like
I think we need to be lax in this case (e.g. forgive all references in the right-hand side of binding statements). Patterns like this are actually fairly common (I discovered it while running the
master
branch against a co-worker's code base):If included in a minor release, this change in application of
latedef
would likely cause trouble for our consumers. I think we ought to be conservative in this case: continue to allow references to the identifier being initialized within the right hand side of a binding. For example:What do you think?
The text was updated successfully, but these errors were encountered: