-
Notifications
You must be signed in to change notification settings - Fork 323
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
Don't let the non-Enso types float around the Enso interpreter! #9584
Don't let the non-Enso types float around the Enso interpreter! #9584
Conversation
Relates to #1239 (comment) |
Here are the warnings about suspicious return types:
@hubertp, @Akirathan let's discuss what do we want to do with them. |
As a result of bcf69a3 there is now AssertionError failure in tests. It should be gone once we merge #9462 - e.g. latest develop in. |
…CheckBuiltinReturnTypes_8982
enso/engine/runtime/src/main/java/org/enso/interpreter/runtime/data/EnsoFile.java Line 134 in c42e6d1
results in Object execute(EnsoFile self) {
EnsoContext context = EnsoContext.get(this);
try {
return context
.asGuestValue(self.getCreationTime()); e.g. a Since a98f0b7 we error on such unnecessary conversion. |
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.
Thanks, always nice to get rid of that hardcoded list.
}; | ||
} | ||
|
||
static boolean isTruffleObject(ProcessingEnvironment processingEnv, TypeMirror type) { |
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.
👍
Here is the current set of suspicious types. Let's:
|
…CheckBuiltinReturnTypes_8982
…CheckBuiltinReturnTypes_8982
Pull Request Description
Failure described in #9462 (comment) discovered that some of our builtins are returning wrong type. Only
long
,double
,boolean
and genericTruffleObject
types are expected in the Enso interpreter. Returning any other type (for examplejava.lang.String
) leads to increased polymorphism and slowdown (or higher memory consumption) of the interpreter as the Truffle AST gets richer to handle more types.This PR modifies the annotation processor to print a warning when a builtin's return type is suspicious. Failures are analyzed and fixed. Remaining cases where a generic
java.lang.Object
is being returned are annotated by@SuppressWarnings("generic-enso-builtin-type")
annotation.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
style guides