squeak-smalltalk / squeak-object-memory

Issues and assets related to the Squeak object memory.
https://bugs.squeak.org
MIT License
13 stars 1 forks source link

FutureNode does not always yield correct selectors #84

Closed codeZeilen closed 1 year ago

codeZeilen commented 1 year ago

FutureNode yields futureDo or futureSend message sends, depending on whether the result of the send is being used or not. The difference between the two is that only futureSend returns a Promise.

The logic for determining whether the result is being used seems incomplete. E.g. the following example does not work:

result := [(2 future: 100) + 3] on: Error do: [].
result then: [:sum | Transcript showln: sum]

Also: There are no tests currently. :P

codeZeilen commented 1 year ago

FixFuturePromises.1.zip

Proposed change set with tests. Other tests are in PromiseTest.

Also: Futures should not be in Kernel but in System, as they heavily rely on Project.

codeZeilen commented 1 year ago

Fixed in Compiler-pre.493