Skip to content

Fix: Random default thread local [fixup #16174]#16568

Merged
ysbaddaden merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:fix/random-thread-local
Jan 14, 2026
Merged

Fix: Random default thread local [fixup #16174]#16568
ysbaddaden merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:fix/random-thread-local

Conversation

@ysbaddaden
Copy link
Collaborator

I noticed a compilation error in the random shard caused by #16174:

 > 559 |         if typeof(next_u).new!(max &- 1) == max &- 1
                                   ^---
Error: undefined method 'new!' for (UInt32 | UInt64).class

The thread local is an internal detail, it doesn't have to be a general Random instance.

@ysbaddaden ysbaddaden added this to the 1.19.0 milestone Jan 13, 2026
@ysbaddaden ysbaddaden self-assigned this Jan 13, 2026
@ysbaddaden ysbaddaden added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:runtime labels Jan 13, 2026
@ysbaddaden ysbaddaden merged commit 36efd4e into crystal-lang:master Jan 14, 2026
43 checks passed
@ysbaddaden ysbaddaden deleted the fix/random-thread-local branch January 14, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants