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

Missing locations introduced by artificial tree paths #346

Open
d367wang opened this issue Jul 30, 2021 · 0 comments
Open

Missing locations introduced by artificial tree paths #346

d367wang opened this issue Jul 30, 2021 · 0 comments

Comments

@d367wang
Copy link

d367wang commented Jul 30, 2021

According to opprop/checker-framework#162, artificial trees are assigned with a fake "path" as if it's a child of the original AST. As a result, there's no corresponding AST path location for an artificial tree, as the following case shows

void foo() {
      bar(new String("a"), new String("b"));
}

void bar(Object... args) {}

At the method invocation, a new-array tree is created as new Object[]{new String(), new String()}.

Since there's no corresponding AST path location for the artificial array creation, the current strategy is to create slots for the array primary type and component types on MISSING_LOCATION, which causes pain when debugging.

Alternative solutions to get rid of MISSING_LOCATION include:
(1) reusing existing AST paths for artificial trees
(2) not annotating the artificial trees during dataflow analysis, but in InferenceVisitor directly building constraints between method parameters and actual argument. Specifically for the above case, typeof(new String("a")) <: typeof(args) and typeof(new String("b")) <: typeof(args).

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

No branches or pull requests

1 participant