From 4d5c674e2d153fc54b8bd992c052da3f3e50a4d3 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Fri, 9 Oct 2026 02:06:52 +0100 Subject: [PATCH] fix(examples): let hello.affine use the builtin println so `just jaffa hello` runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The example declared its own `effect IO { fn println(s: String) -> (); }`. That declaration shadows AffineScript's builtin `println`, which already carries the `IO` effect. `eval` then performs the declared effect, finds no handler, and stops with "Runtime error: Unhandled effect: println" (exit 124, affinescript's own error code; it is not a timeout). Dropping the declaration makes check, eval, compile, preview-js and lint all pass under affinescript 0.1.1, through `just jaffa …` and `bin/jaffa`. The README's copy of the example gets the same change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GpUzjdhWFi26k6s7AWxYcf --- README.adoc | 4 ---- examples/hello.affine | 9 +++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.adoc b/README.adoc index a881502..40469bb 100644 --- a/README.adoc +++ b/README.adoc @@ -35,10 +35,6 @@ strongly-typed, affine-typed, WASM-targeting world ---- // face: jaffascript -effect IO { - fn println(s: String) -> (); -} - function main() -{IO}-> () { const greeting = "Hello, JaffaScript!"; println(greeting); diff --git a/examples/hello.affine b/examples/hello.affine index 43d00fe..73f6ead 100644 --- a/examples/hello.affine +++ b/examples/hello.affine @@ -5,10 +5,11 @@ // `const`/`let` bindings (let lowers to let mut), brace-delimited // blocks, `===` equality. // face: jaffascript - -effect IO { - fn println(s: String) -> (); -} +// +// `println` is the AffineScript builtin, which already carries the `IO` +// effect. Do not declare `effect IO { fn println … }` here: a declared +// effect shadows the builtin, and `eval` then stops with +// "Unhandled effect: println" because nothing handles it. function main() -{IO}-> () { const greeting = "Hello, JaffaScript!";