-
Notifications
You must be signed in to change notification settings - Fork 4
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
Finding implicit this. #54
base: master
Are you sure you want to change the base?
Conversation
32bce76
to
f14f8ff
Compare
098a7e6
to
2513add
Compare
@@ -1391,6 +1420,9 @@ TypeDecl: abstract class extends Declaration { | |||
// if the variable is static, use class scope not instance | |||
name := vDecl isStatic() ? "This" : "this" | |||
call setExpr(VariableAccess new(name, call token)) | |||
if (res params explicitThis) { | |||
call token printMessage("Implicit " + name + " detected for call to " + vDecl name + "!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that this is function calls by pointer from the table since variables are used for access.
e689e32
to
be2af46
Compare
// add `this` if needed. | ||
call setExpr(VariableAccess new("this", call token)) | ||
} | ||
// Not yet tested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have to assume that it does not give false detection until someone uses addons while not using implicit this.
This style warning is optional with a compiler flag so that it can exist in both versions of rock.
Missing a few rare style errors might be acceptable to save time but false positives would bloat the output.