ScopedValue.runWhere not returning scope

Andrew Haley aph-open at littlepinkcloud.com
Tue Jun 11 09:04:11 UTC 2024


On 6/10/24 23:40, Pedro Lamarão wrote:
> This benefit of having ScopedValues "plug and play" into some interceptor
> architecture would come at the cost of removing the structural guarantee
> that ScopedValues scopes are entered and left correctly.
> That guarantee would be degraded to a user requirement, which the platform
> would*not*  be allowed to assume at the risk of undefined behaviour -- what
> happens if a super scope is closed before a sub scope?

Absolutely, yes. Thank you.

It's better to have an API where some incorrect usages cannot even be expressed
than an API that has to do runtime checking for those incorrect usages.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the loom-dev mailing list