feat: execute source control flow and exact real arithmetic

This commit is contained in:
2026-11-12 10:48:27 +08:00
parent f3e1670c58
commit 5ff1c68f5f
28 changed files with 1045 additions and 117 deletions
+14 -3
View File
@@ -262,11 +262,22 @@ fn declared_field_checks_cover_construction_inheritance_writes_and_gc() {
r#"
class Base { count: Number }
class Child: Base { label: String }
value = Child(9, "ok")
class Holder { child: Base }
holder = Holder(value)
class Unknown { value: Missing }
"#,
ParseMode::Module,
);
// Interactive intentionally accepts one complete statement per source unit.
execute(
&mut vm,
globals,
r#"value = Child(9, "ok")"#,
ParseMode::Interactive,
);
execute(
&mut vm,
globals,
"holder = Holder(value)",
ParseMode::Interactive,
);
let Value::Object(value) = vm
@@ -334,7 +345,7 @@ fn checked_fields_keep_declaring_self_type_and_can_be_opted_out() {
class Link { next: Link }
class Seed: Link {}
"#,
ParseMode::Interactive,
ParseMode::Module,
);
// A recursive nonnullable field can be initialized by the trusted host in two steps.
let Value::Object(link) = vm