mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- 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:
@@ -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"]!!);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user