Removing use of $assignable and deprecate it. Fix regression for stacktraces on MacOS. Added readline_to_stream. Regression: Chaining an optional together with contracts could in some cases lose the optional.

This commit is contained in:
Christoffer Lerno
2025-07-21 03:20:40 +02:00
parent 382a65abcd
commit 869bcf8b2b
18 changed files with 116 additions and 69 deletions

View File

@@ -6,7 +6,7 @@ alias IntMap = HashMap{String, int};
fn void copy_map() @test
{
TrackingAllocator alloc;
alloc.init(allocator::heap());
alloc.init(mem);
defer alloc.free();
assert(alloc.allocated() == 0);
mem::@scoped(&alloc)

View File

@@ -3,14 +3,14 @@ import std::collections::object;
fn void test_general()
{
Object* root = object::new_obj(allocator::heap());
Object* root = object::new_obj(mem);
defer root.free();
root.set("foo", 1);
root.set("bar", "baz");
assert(root.get_int("foo")!! == 1);
assert(root.get_string("bar")!! == "baz");
Object* goo = root.set("goo", object::new_obj(allocator::heap()));
Object* goo = root.set("goo", object::new_obj(mem));
goo.push("hello");
goo.push(132);
assert(root.get("goo").get_int_at(1)!! == 132);
@@ -27,14 +27,14 @@ fn void test_general()
fn void test_to_format_int()
{
{
Object* int_object = object::new_int(16, allocator::heap());
Object* int_object = object::new_int(16, mem);
defer int_object.free();
String s = string::format(mem, "%s", int_object);
defer free(s);
assert(s == "16");
}
{
Object* int_object = object::new_int(-16, allocator::heap());
Object* int_object = object::new_int(-16, mem);
defer int_object.free();
String s = string::format(mem, "%s", int_object);
defer free(s);