[ fixup #2939 ] Make futures not interfere with optimisations #3292
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.
Description
Fix in #2939 accidentally broke one (actually, inconsistent) assumption about how the lazy values are managed. This may lead to a crash, you can see an example in the newly added test. Incidentally, this does not crash on chez (yet) because of undocumented coindicence of two runtime representations in the current particular implementation (dynamically-typed languages, omg), but this can change in the future at any time. Racket fails properly.
I changed the way the primitive
prim__makeFuture
is called: now it reuses the way the forcing is actually implemented instead of trying to assume particular implementation. We should be more stable on potential future changes of the way lazy values are treated after this PR.Pinging @mjustus as the merger of #2939.
UPD: Oh, and I found that one racket test actually run on chez, I think that was a copy-paste error, so I changed it.