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

Fix unprintable class when param types are inferred from assignments using -Ainfer=stubs #3436

Merged
merged 1 commit into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ public void updateFromLocalAssignment(

String className = getEnclosingClassName(lhs);
String jaifPath = storage.getJaifPath(className);
AClass clazz = storage.getAClass(className, jaifPath);
AClass clazz =
storage.getAClass(
className,
jaifPath,
(ClassSymbol) TreeUtils.elementFromDeclaration(classTree));
ExecutableElement methodElt = TreeUtils.elementFromDeclaration(methodTree);
AMethod method = clazz.methods.getVivify(JVMNames.getJVMMethodSignature(methodElt));
method.setFieldsFromMethodElement(methodElt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void writeToFile(
/**
* Updates the symbol information stored in AClass for the given class. May be called multiple
* times (and needs to be if the second parameter was null the first time it was called; only
* some calls provide the symbol inforamtion).
* some calls provide the symbol information).
*
* @param aClass the class representation in which the symbol information is to be updated
* @param classSymbol the source of the symbol information; may be null, in which case this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,11 @@ void test() {
expectsSibling1(field2);
}
}

class AssignParam {
public void f(@WholeProgramInferenceBottom Object param) {
// :: error: assignment.type.incompatible
param = ((@Top Object) null);
}
}
}