feat: execute source control flow and exact real arithmetic
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user