- Incorrect type checking when &[] and [] return optional values.

- Failed to find subscript overloading on optional values.
- Added `&[]` overload to HashMap.
This commit is contained in:
Christoffer Lerno
2025-08-19 00:40:56 +02:00
parent ba55946c9a
commit de09a19a48
5 changed files with 39 additions and 5 deletions

View File

@@ -103,3 +103,16 @@ fn void map_copy()
assert(hash_map_copy.len() == hash_map.len());
}
alias Test = HashMap{String, HashMap {String, String}};
fn void test_ref()
{
Test t;
t.init(tmem);
(&t["a"]).init(tmem);
(*&t["a"])["b"] = "ab";
test::eq("ab", t["a"]["b"]!!);
}