-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Bug description
Actual behavior
Dict is complaining saying that we are trying to write to a place readable by another argument. It's not true. Could be an origin issue in the Dict._find_ref who tries to get the origin from the underlying optional value.
Expected behavior
Should not complain because we are not replacing or modifying the key in any case.
Steps to reproduce
fn some_test() raises:
some_str = String("hello,world") # simple string
slice = StringSlice(some_str) # create an slice with an immutable origin
parts = slice.split(",")
dct = Dict[__type_of(slice).Immutable, Int]()
for part in parts:
dct[part] # Do not fail but it's unusable. Try to assign it to something and will fail
dct[part] = 0 # argument of '__setitem__' call allows writing a memory location previously readable through another aliased argument
dct.setdefault(part, 0) # argument of '__setitem__' call allows writing a memory location previously readable through another aliased argument
dct.get(part, 0) # argument of '__setitem__' call allows writing a memory location previously readable through another aliased argument
System information
Pixi version: 0.47.0
Platform: linux-64
Virtual packages: __unix=0=0
: __linux=6.6.87.1=0
: __glibc=2.35=0
: __cuda=12.6=0
: __archspec=1=skylake
Package Version Build Size Kind Source
max 25.4.0.dev2025052905 release 9.2 KiB conda https://conda.modular.com/max-nightly/
max-core 25.4.0.dev2025052905 release 211.7 MiB conda https://conda.modular.com/max-nightly/
max-python 25.4.0.dev2025052905 release 13.9 MiB conda https://conda.modular.com/max-nightly/