#optional argument being ignored?

1 messages · Page 1 of 1 (latest)

wispy jacinth
#

you get an error during compile time because the branch is still reachable, the compiler doesn't know at compile time that you will never pass null to the function so it cannot know that getrandom will never be called

desert prairie
#

wasnt this asked yesterday and like three people answered? :p

#

i mean, to figure out better ways of solving it, not asking the same exact quesroon

#

why not have rng in wasm though

#

you can override the rng function

#

and it'll use thay

#

look at how rand crate does rng for wasm

wispy jacinth
#

you can override the cryptoRandomSeed function in std.options fwiw

#

you can't, the parameter isn't comptime known

#

you probably also want to set crypto_always_getrandom to true so that it always calls cryptoRandomSeed