<div dir="ltr">A possibly better solution is to create:<div><br></div><div>```java</div><div>    @FunctionalInterface</div><div>    interface GCallable<R, E extends Throwable> {<br>        R call() throws E;</div><div>    }<br></div><div>```</div><div>And use this interface.</div><div>It will require changing the signature of `Carrier#runWith` (and hence modifying `JVM_FindScopedValueBindings`) and of 3 methods in `ScopedValueContainer` (alternatively only changing the signature of `Carrier#runWith` and the implementation of `ScopedValueContainer#call`), but everything else could be left unchanged, and letting Java infer the exception needed.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 23, 2023 at 6:32 PM Andrew Haley <<a href="mailto:aph-open@littlepinkcloud.com">aph-open@littlepinkcloud.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/23/23 11:16, Kasper Nielsen wrote:<br>
> So I would really like something like<br>
>   <R> R supply(Supplier<? extends R> op);<br>
> on ScopedValue.Carrier<br>
<br>
What would supply() do? Just like call() but without an exception?<br>
<br>
-- <br>
Andrew Haley  (he/him)<br>
Java Platform Lead Engineer<br>
Red Hat UK Ltd. <<a href="https://www.redhat.com" rel="noreferrer" target="_blank">https://www.redhat.com</a>><br>
<a href="https://keybase.io/andrewhaley" rel="noreferrer" target="_blank">https://keybase.io/andrewhaley</a><br>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Holo The Wise Wolf Of Yoitsu</div></div>