1.2 KiB
1.2 KiB
AI Agent Notes
Kotlin/Wasm generation guardrails
- Avoid creating suspend lambdas for compiler runtime statements. Prefer explicit
object : Statement()withoverride suspend fun execute(...). - Do not use
statement { ... }or other inline suspend lambdas in compiler hot paths (e.g., parsing/var declarations, initializer thunks). - If you need a wrapper for delegated properties, check for
getValueexplicitly and return a concreteStatementobject when missing; avoidonNotFoundResultlambdas. - If wasmJs browser tests hang, first run
:lynglib:wasmJsNodeTestand look for wasm compilation errors; hangs usually mean module instantiation failed. - Do not increase test timeouts to mask wasm generation errors; fix the invalid IR instead.
Type inference notes (notes/type_system_spec.md)
- Nullability is Kotlin-style:
Tnon-null,T?nullable,!!asserts non-null. voidis a singleton of classVoid(syntax sugar for return type).- Object member access requires explicit cast; remove
inspectfrom Object and usetoInspectString()instead. - Do not reintroduce bytecode fallback opcodes (e.g.,
GET_NAME,EVAL_*,CALL_FALLBACK) or runtime name-resolution fallbacks; all symbol resolution must stay compile-time only.