Repository navigation
Static methods used as values obey :static-methods config - #1118
Merged
Merged
Conversation
A closed class's unlisted static method was denied when called directly but callable when taken as a value ((let [f Integer/toHexString] (f 255))), and a :static-methods override was ignored in value position. The value path now resolves member-disposition like the direct call.
whilo
added a commit
to replikativ/dvergr
that referenced
this pull request
Oct 23, 2026
Rebased onto upstream SCI 0.15.59, plus the fix proposed upstream as babashka/sci#1118. Random/from is now refused when taken as a value too, so the note that it stayed reachable goes; the test pins it.
whilo
added a commit
to replikativ/dvergr
that referenced
this pull request
Oct 23, 2026
…#394) * Sandbox: seeded java.util.Random and SplittableRandom for simulations Agents building simulations reach for java.util.Random and found it refused (a company-cash attempt spent turns rewriting its model around rand). Both classes are now exposed, closed to their draw methods: no stream methods (doubles, ints, …), and SecureRandom stays out. A seed repeats the same worlds, so plans compare on common random numbers and runs can be repeated; SplittableRandom's split gives each world or entity its own stream. The clojure_eval description says so. * Sandbox Random: note that Random/from stays reachable as a value, and why that is harmless * SCI 0.15.59-replikativ.2: static methods as values obey closed classes Rebased onto upstream SCI 0.15.59, plus the fix proposed upstream as babashka/sci#1118. Random/from is now refused when taken as a value too, so the note that it stayed reachable goes; the test pins it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A closed class's unlisted static method is denied when called directly, but callable when taken as a value:
and a
:static-methodsoverride is ignored in value position ((let [f Integer/valueOf] (f "42"))reflects instead of calling the override).The value branch of
analyze-interopbuilt the reflective fn without consultingmember-disposition; it now resolves:override/:deny/:reflectlike the direct static call does. Tests added next to the existing closed-class static-method tests (sci.interop-test: 22 tests, 185 assertions, 0 failures; the new assertions fail without the change).