-
Notifications
You must be signed in to change notification settings - Fork 326
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
Delay check of suspended arguments until they are about to be computed #7727
Delay check of suspended arguments until they are about to be computed #7727
Conversation
try { | ||
org.enso.interpreter.runtime.EnsoContext ctx = EnsoContext.get(this); | ||
java.lang.Object newValue = invoke.execute(fn, null, State.create(ctx), new Object[0]); | ||
set.execute(atom, newValue); | ||
return newValue; | ||
} catch (AbstractTruffleException ex) { | ||
var rethrow = new SuspendedException(ex); | ||
var rethrow = DataflowError.withTrace(ex, ex); | ||
set.execute(atom, rethrow); |
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.
set.execute
was failing with SuspendedException
because the lazy field are runtime type checked and SuspendedException
didn't have the right type ;-)
Changing into DataflowError
as that is isAllFitValue
.
assertNotNull("member found", thirteen); | ||
assertEquals(13, thirteen.asInt()); | ||
|
||
var someHello = complex.execute("Hello", "World"); |
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.
Constructing Int.Complex
is allowed, as the unwrap
value is left as thunk. Only reading it later yields the error.
Pull Request Description
Fixes #6883 by wrapping suspended arguments by
Function
that adds a type check on the computed value.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Java,