Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

davidpiuva
Copy link

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.

@davidpiuva davidpiuva changed the title First prototype for finding implicit this. Finding implicit this. Mar 17, 2016
@davidpiuva davidpiuva force-pushed the explicit branch 3 times, most recently from 32bce76 to f14f8ff Compare March 21, 2016 11:52
@davidpiuva davidpiuva force-pushed the explicit branch 2 times, most recently from 098a7e6 to 2513add Compare March 22, 2016 10:59
@@ -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 + "!")
Copy link
Author

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.

@davidpiuva davidpiuva force-pushed the explicit branch 2 times, most recently from e689e32 to be2af46 Compare March 29, 2016 10:21
// add `this` if needed.
call setExpr(VariableAccess new("this", call token))
}
// Not yet tested
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants