diff --git a/bytecode_migration_plan.md b/bytecode_migration_plan.md index ef04005..12b0415 100644 --- a/bytecode_migration_plan.md +++ b/bytecode_migration_plan.md @@ -53,9 +53,9 @@ Goal: migrate the compiler so all values live in frames/bytecode, keeping JVM te - [x] Step 15: Class-scope `?=` in bytecode. - [x] Handle `C.x ?= v` and `C?.x ?= v` for class-scope members without falling back. - [x] Add a JVM test for class-scope `?=` on static vars. -- [ ] Step 16: Remove dead `ToBoolStatement`. - - [ ] Confirm no parser/compiler paths construct `ToBoolStatement` and delete it plus interpreter hooks. - - [ ] Keep JVM tests green after removal. +- [x] Step 16: Remove dead `ToBoolStatement`. + - [x] Confirm no parser/compiler paths construct `ToBoolStatement` and delete it plus interpreter hooks. + - [x] Keep JVM tests green after removal. - [x] Step 17: Callable property calls in bytecode. - [x] Support `CallRef` where the target is a `FieldRef` (e.g., `(obj.fn)()`), keeping compile-time resolution. - [x] Add a JVM test for a callable property call compiled to bytecode. diff --git a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/statements.kt b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/statements.kt index 92e9308..aea333f 100644 --- a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/statements.kt +++ b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/statements.kt @@ -439,15 +439,6 @@ class ThrowStatement( } } -class ToBoolStatement( - val expr: Statement, - override val pos: Pos, -) : Statement() { - override suspend fun execute(scope: Scope): Obj { - return if (expr.execute(scope).toBool()) net.sergeych.lyng.obj.ObjTrue else net.sergeych.lyng.obj.ObjFalse - } -} - class ExpressionStatement( val ref: net.sergeych.lyng.obj.ObjRef, override val pos: Pos