-
Notifications
You must be signed in to change notification settings - Fork 328
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
Return function schema for atom constructors #8743
Merged
mergify
merged 5 commits into
develop
from
wip/db/8663-provide-info-about-constructor-calls
Jan 12, 2024
Merged
Return function schema for atom constructors #8743
mergify
merged 5 commits into
develop
from
wip/db/8663-provide-info-about-constructor-calls
Jan 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java
Show resolved
Hide resolved
Api.FunctionSchema(methodPointer, notAppliedArguments) | ||
) | ||
case atomConstructor: AtomConstructor => | ||
val functionInfo = new FunctionPointer( |
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.
Create FunctionPointer.fromConstructor(...)
method and test it with #8663 (comment) test.
hubertp
approved these changes
Jan 12, 2024
assertEquals("ConstructorPointer.X", c.typeName().toString()); | ||
assertEquals("Run", c.functionName()); | ||
|
||
var d = FunctionPointer.fromAtomConstructor((AtomConstructor) rawRes); |
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.
Thank you.
2 tasks
mergify bot
pushed a commit
that referenced
this pull request
Mar 15, 2024
The `null` check creates a new Array but always assumed a non-empty one which may lead to ``` java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at org.enso.runtime/org.enso.interpreter.service.ExecutionService$FunctionPointer.collectNotAppliedArguments(ExecutionService.java:778) at org.enso.runtime/org.enso.interpreter.instrument.job.ProgramExecutionSupport$.sendExpressionUpdate(ProgramExecutionSupport.scala:430) at org.enso.runtime/org.enso.interpreter.instrument.job.ProgramExecutionSupport$.$anonfun$executeProgram$3(ProgramExecutionSupport.scala:81) at org.enso.runtime/org.enso.interpreter.service.ExecutionCallbacks.callOnComputedCallback(ExecutionCallbacks.java:146) at org.enso.runtime/org.enso.interpreter.service.ExecutionCallbacks.updateCachedResult(ExecutionCallbacks.java:117 ... ``` Added a guard to prevent the exception. The flag will be useless anyway as we won't enter the for-loop in this case. Appears to be introduced via #8743. Discovered while debugging #9389.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CI: Clean build required
CI runners will be cleaned before and after this PR is built.
CI: No changelog needed
Do not require a changelog entry for this PR.
CI: Ready to merge
This PR is eligible for automatic merge
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
close #8663
Changelog:
MethodRootNode
for the atom constructor function to preserve the call info in runtimeImportant Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.