From 49f5964eae5f993682e235a29d7d8634e26f4d4d Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Fri, 6 Nov 2026 18:40:31 +0000 Subject: [PATCH 1/3] Bitwise results are s32; an empty [] in a conditional; references laid out alike (TSLANG 24-26) - 24: `[1 << 18, w]` with `w: int` was an s64 array. Shifts, `&`, `|` and `^` cast their operands to a signless i32, and a signless integer merged with a signed one widens to s64 (the rule meant for lengths). They are ToInt32's signed 32-bit integer now, as `int` is; `>>>` keeps its unsigned result. `typeof (a & 1)` is "s32". - 25: `cond ? [1] : []` crashed when iterated: `[]` is an empty `any` array, and the merge was a union `s32[] | any[]` that `for...of` read through its tag. An empty array literal takes the other branch's array type, as TypeScript gives it. - 26: `Ref(numbers[0])` passed to a `Ref` handed a `double*` on as a `float*`. A reference to a scalar number cast to one to a number laid out otherwise is an error now. Tests 00tslang_issues_24_26 (gc, rc, none, own) and ref_element_layout_error. Co-Authored-By: Claude Opus 5.5 --- tslang/lib/TypeScript/MLIRGenCast.cpp | 38 ++++++++++ tslang/lib/TypeScript/MLIRGenExpressions.cpp | 22 +++++- tslang/lib/TypeScript/MLIRGenImpl.h | 6 +- tslang/test/tester/CMakeLists.txt | 11 +++ .../tester/tests/00tslang_issues_24_26.ts | 72 +++++++++++++++++++ .../tester/tests/ref_element_layout_error.ts | 17 +++++ tslang/test/tester/verify-ownership.cmake | 4 +- 7 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 tslang/test/tester/tests/00tslang_issues_24_26.ts create mode 100644 tslang/test/tester/tests/ref_element_layout_error.ts diff --git a/tslang/lib/TypeScript/MLIRGenCast.cpp b/tslang/lib/TypeScript/MLIRGenCast.cpp index 23b5dc72b..696a26256 100644 --- a/tslang/lib/TypeScript/MLIRGenCast.cpp +++ b/tslang/lib/TypeScript/MLIRGenCast.cpp @@ -982,6 +982,44 @@ namespace mlirgen } } + // a reference is the address of what it refers to: one to a number (a double) handed on as a + // `Ref` is a `double*` read as a `float*`. Numbers referred to must be laid out alike + if (auto destRefType = dyn_cast(type)) + { + if (auto srcRefType = dyn_cast(valueType)) + { + // {is float, width} of a scalar number, or none + auto layoutOf = [](mlir::Type elementType) -> std::optional> { + if (isa(elementType)) + { + return std::make_pair(true, 64u); + } + + if (auto floatType = dyn_cast(elementType)) + { + return std::make_pair(true, floatType.getWidth()); + } + + if (auto intType = dyn_cast(elementType); intType && intType.getWidth() > 1) + { + return std::make_pair(false, intType.getWidth()); + } + + return std::nullopt; + }; + + auto srcLayout = layoutOf(srcRefType.getElementType()); + auto destLayout = layoutOf(destRefType.getElementType()); + if (srcLayout && destLayout && *srcLayout != *destLayout) + { + emitError(location) << "a reference to " << to_print(srcRefType.getElementType()) + << " can't be used as a reference to " << to_print(destRefType.getElementType()) + << ": what it refers to is laid out otherwise"; + return mlir::failure(); + } + } + } + if (auto result = castFromSourceSpecialCases(location, type, value, valueType, genContext)) { return *result; diff --git a/tslang/lib/TypeScript/MLIRGenExpressions.cpp b/tslang/lib/TypeScript/MLIRGenExpressions.cpp index f8ba7d746..fc130f9e1 100644 --- a/tslang/lib/TypeScript/MLIRGenExpressions.cpp +++ b/tslang/lib/TypeScript/MLIRGenExpressions.cpp @@ -817,6 +817,22 @@ namespace mlirgen }; auto trueType = widenArrayLiteral(resultTrue.getType()); auto falseType = widenArrayLiteral(resultFalse.getType()); + + // an empty array literal is an array of the other branch's elements: TypeScript has + // `c ? [1] : []` a `number[]`. Left an `any[]`, the merge was a union `s32[] | any[]` + // whose `for...of` read the array through the union's tag and crashed + auto isEmptyArrayLiteral = [](mlir::Type type) { + auto constArrayType = dyn_cast(type); + return constArrayType && constArrayType.getSize() == 0; + }; + if (isEmptyArrayLiteral(resultFalse.getType()) && isa(trueType)) + { + falseType = trueType; + } + else if (isEmptyArrayLiteral(resultTrue.getType()) && isa(falseType)) + { + trueType = falseType; + } auto defaultUnionType = getUnionType(location, trueType, falseType); auto merged = false; auto resultType = mth.findBaseType(trueType, falseType, merged, defaultUnionType); @@ -832,7 +848,11 @@ namespace mlirgen auto array = value; if (isa(value.getType())) { - auto result = cast(location, mth.removeConstType(value.getType()), value, genContext); + // an empty literal is made an array of the merged type's elements directly + auto arrayType = isEmptyArrayLiteral(value.getType()) && isa(resultType) + ? resultType + : mth.removeConstType(value.getType()); + auto result = cast(location, arrayType, value, genContext); if (result.failed_or_no_value()) { return mlir::Value(); diff --git a/tslang/lib/TypeScript/MLIRGenImpl.h b/tslang/lib/TypeScript/MLIRGenImpl.h index 24cb78a01..266e157bc 100644 --- a/tslang/lib/TypeScript/MLIRGenImpl.h +++ b/tslang/lib/TypeScript/MLIRGenImpl.h @@ -8245,7 +8245,11 @@ class MLIRGenImpl // cast to int: JavaScript's Int32 coercion, but a 64-bit integer left operand keeps its // type (and signedness), the right one is cast to it. Cast to i32, `u64 << 40` shifted // by 40 mod 32 and dropped the upper half. - mlir::Type intType = builder.getI32Type(); + // ToInt32 is signed: `1 << 18` is an s32 as `int` is, so `[1 << 18, w]` with `w: int` is an + // s32[]. Signless, it merged with s32 as an index would, to s64. `>>>` is ToUint32's + mlir::Type intType = opCode == SyntaxKind::GreaterThanGreaterThanGreaterThanToken + ? builder.getI32Type() + : mlir::IntegerType::get(builder.getContext(), 32, mlir::IntegerType::Signed); if (auto leftIntType = dyn_cast(leftExpressionValue.getType())) { if (leftIntType.getWidth() > 32) diff --git a/tslang/test/tester/CMakeLists.txt b/tslang/test/tester/CMakeLists.txt index 351379912..889d0a24e 100644 --- a/tslang/test/tester/CMakeLists.txt +++ b/tslang/test/tester/CMakeLists.txt @@ -754,6 +754,7 @@ tslang_add_test(NAME test-compile-00-closure-fewer-parameters COMMAND test-runne tslang_add_test(NAME test-compile-00-in-interface-union COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/00in_interface_union.ts") tslang_add_test(NAME test-compile-00-class-values COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/00class_values.ts") tslang_add_test(NAME test-compile-00-mixins COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/00mixins.ts") +tslang_add_test(NAME test-compile-00-tslang-issues-24-26 COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/00tslang_issues_24_26.ts") tslang_add_test(NAME test-compile-00-class-arrow-fields COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/00class_arrow_fields.ts") tslang_add_test(NAME test-compile-00-class-arrow-getter COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/00class_arrow_getter.ts") tslang_add_test(NAME test-compile-00-interface-generic-method COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/00interface_generic_method.ts") @@ -1774,6 +1775,16 @@ set_tests_properties(test-compile-class-value-constructor-error PROPERTIES PASS_ foreach(mixin_mm gc rc none own) tslang_add_test(NAME test-jit-00-mixins-${mixin_mm} COMMAND test-runner -jit -mm=${mixin_mm} "${PROJECT_SOURCE_DIR}/test/tester/tests/00mixins.ts") endforeach() +# TSLANG_ISSUES 24-26 (bitwise results are s32, an empty array literal in a conditional, references laid +# out alike) under every memory model +foreach(issues_mm gc rc none own) + tslang_add_test(NAME test-jit-00-tslang-issues-24-26-${issues_mm} COMMAND test-runner -jit -mm=${issues_mm} "${PROJECT_SOURCE_DIR}/test/tester/tests/00tslang_issues_24_26.ts") +endforeach() +# ...a reference to a number is no reference to an f32 +add_test(NAME test-compile-ref-element-layout-error + COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/ref_element_layout_error.ts") +set_tests_properties(test-compile-ref-element-layout-error PROPERTIES PASS_REGULAR_EXPRESSION "a reference to number can't be used as a reference to f32" + FAIL_REGULAR_EXPRESSION "Stack dump|Assertion failed") # ...a class extending a class value known at run time only is an error add_test(NAME test-compile-mixin-runtime-base-error COMMAND test-runner "${PROJECT_SOURCE_DIR}/test/tester/tests/mixin_runtime_base_error.ts") diff --git a/tslang/test/tester/tests/00tslang_issues_24_26.ts b/tslang/test/tester/tests/00tslang_issues_24_26.ts new file mode 100644 index 000000000..7fe09ea7e --- /dev/null +++ b/tslang/test/tester/tests/00tslang_issues_24_26.ts @@ -0,0 +1,72 @@ +// TSLANG_ISSUES 24 and 25, and the references 26 still allows. + +// 24: a shift, `&`, `|` or `^` is ToInt32's signed 32-bit integer, as `int` is: an array literal holding +// `1 << 18` and an `int` is an int array, not one of 64-bit integers +const CAP = 1 << 18; +const MASK = 0xff & 0x0f; + +class Grid { + w: int = 290; + + header() { + return [CAP, this.w, MASK | 1]; + } +} + +// 25: an empty array literal against a non-empty one is an array of the other's elements +class S { + scene: int = 4; + + check(): int { + const expected = this.scene == 4 ? [1] : []; + let sum = 0; + for (const k of expected) { + sum += k; + } + + return sum; + } + + nested(): int { + const expected = this.scene == 2 ? [0, 2] : this.scene == 4 ? [1] : this.scene == 5 ? [2, 3] : []; + let sum = 0; + for (const k of expected) { + sum += k; + } + + return sum + expected.length * 10; + } + + emptyFirst(): int { + const expected = this.scene != 4 ? [] : [5, 6]; + return expected.length; + } +} + +// 26: a reference to a number laid out as the parameter's is accepted +function fillF32(dst: Ref) { + return 1; +} + +function fillInt(dst: Ref) { + return 2; +} + +function main() { + const header = new Grid().header(); + assert(header.length == 3 && header[0] == 262144 && header[1] == 290 && header[2] == 15, "values"); + assert(sizeof(header[0]) == 4, "an int array"); + + const s = new S(); + assert(s.check() == 1, "the non-empty branch"); + assert(s.nested() == 11, "nested conditionals"); + assert(s.emptyFirst() == 2, "the empty literal first"); + s.scene = 3; + assert(s.check() == 0 && s.nested() == 0 && s.emptyFirst() == 0, "the empty branch"); + + const floats: f32[] = [1, 2, 3]; + const ints: int[] = [1, 2, 3]; + assert(fillF32(Ref(floats[0])) == 1 && fillInt(Ref(ints[1])) == 2, "references laid out alike"); + + print("done."); +} diff --git a/tslang/test/tester/tests/ref_element_layout_error.ts b/tslang/test/tester/tests/ref_element_layout_error.ts new file mode 100644 index 000000000..4b5d7b15c --- /dev/null +++ b/tslang/test/tester/tests/ref_element_layout_error.ts @@ -0,0 +1,17 @@ +// TSLANG_ISSUES 26: a reference to a number (a double) is no `Ref`: the function would read a +// `double*` as a `float*`. +declare function Fill(enable: int, dst: Ref): int; + +class A { + sensed: number[] = [0.0, 0.0, 0.0]; + + run() { + Fill(1, Ref(this.sensed[0])); + print(this.sensed[0]); + } +} + +function main() { + const a = new A(); + a.run(); +} diff --git a/tslang/test/tester/verify-ownership.cmake b/tslang/test/tester/verify-ownership.cmake index 884a08bdb..2c1f9c8ec 100644 --- a/tslang/test/tester/verify-ownership.cmake +++ b/tslang/test/tester/verify-ownership.cmake @@ -55,7 +55,9 @@ set(not_compilable_alone class_field_capture_error.ts cpp_class_value_error.ts # an error by design (test-compile-mixin-runtime-base-error) - mixin_runtime_base_error.ts) + mixin_runtime_base_error.ts + # an error by design (test-compile-ref-element-layout-error) + ref_element_layout_error.ts) file(GLOB corpus "${TESTS_DIR}/*.ts") list(SORT corpus) From ef681c6adb62d0803434ed5bba39aa7da46202a4 Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Fri, 6 Nov 2026 18:40:52 +0000 Subject: [PATCH 2/3] TSLANG_ISSUES: 24, 25 and 26 Co-Authored-By: Claude Opus 5.5 --- TSLANG_ISSUES.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/TSLANG_ISSUES.md b/TSLANG_ISSUES.md index a92feb7e3..033403c8e 100644 --- a/TSLANG_ISSUES.md +++ b/TSLANG_ISSUES.md @@ -10,3 +10,99 @@ file's git history. The last two: 22 (`T | null` of a `@value` type whose only f interface crashed the compiler, a regression from #760) was fixed by #763; 23 (`h && cond` with `h` a `@cpp` class `| null` failed with "instanceof can't be used with a @cpp class") was fixed by #765, regression test `tslang/test/tester/tests/00cpp_union_truth.ts`. + +### 26. `Ref(x)` of a `number` (f64) is accepted for a `Ref` parameter, passing a `double*` as `float*` + +tslang v0.0-pre-alpha115, Windows x64. Repro (compiled with `tslang -emit=llvm r.ts -o r.ll`, no +diagnostic): + +```ts +declare function Fill(enable: int, dst: Ref): int; +class A { + sensed: number[] = [0.0, 0.0, 0.0]; + run() { + Fill(1, Ref(this.sensed[0])); + print(this.sensed[0]); + } +} +function main() { const a = new A(); a.run(); } +``` + +IR: `%14 = getelementptr double, ptr %12, i32 0` then `call i32 @Fill(i32 1, ptr %14)`: the double +array's pointer goes to the `float*` parameter unchanged. A native function writing 3 floats fills +the first double with the x and y floats' bits (the double's sign and exponent come from y) and half +of the second. Expected: a type error (`Ref` isn't a `Ref`). The `Ref` declaration +is meant to type-check this; with `sensed: f32[]` the IR is `getelementptr float`, as expected. + +Where it bit: native_ts_graphics' powder_sandbox_nri, tilt gravity, `Nri_GetGravity(1, +Ref(this.sensed[0]))` with `sensed: number[]`. On a phone the gravity pointed right when held upright, +left upside down, and stayed put when held sideways. Workaround: declare the array `f32[]` (branch +powder-tilt-gravity-f32). + +### 25. `cond ? [1] : []` (an empty array literal against a non-empty one) crashes when iterated + +tslang v0.0-pre-alpha113, JIT, Windows x64. Repro (run): + +```ts +class S { + scene: int = 4; + + check(): int { + const expected = this.scene == 4 ? [1] : []; + let sum = 0; + for (const k of expected) { + sum += k; + } + return sum; + } +} + +function main() { + console.log(`${new S().check()}`); +} +``` + +It crashes (`Exception Code: 0xC0000005`) when the non-empty branch is taken. With `this.scene == 3` +(the empty branch taken) it prints 0; `cond ? [1] : [2, 3]` prints 1 and `cond ? [1, 2] : [3, 4]` +prints 3, so it's the empty literal against a non-empty one. `--emit=llvm`: the ternary's result is +`alloca <{ ptr, <{ [1 x i64] }> }>`, a tagged union (a type descriptor, `@td_..._array`, then the +array), each branch storing `<{ ptr, ptr }>` into it, rather than one array type (TypeScript gives +the expression `number[]`); `for...of` over that union is where it fails. + +Where it bites: native_ts_graphics' powder_sandbox_nri, the sound events a test scene must have, +`this.scene == 2 ? [0, 2] : (this.scene == 4 ? [1] : (this.scene == 5 ? [2, 3] : []))`, segfaulted +in scene 4 right after logging them. Workaround: `const expected: int[] = [];` and `push` the values +in `if` branches. + +### 24. An array literal holding a `const X = 1 << n` widens to 64-bit elements + +tslang v0.0-pre-alpha113, JIT and `--emit=llvm`, Windows x64. Repro (run): + +```ts +const CAP = 1 << 18; + +class Grid { + w: int = 290; + size(): int { + const a = [CAP, this.w]; + return a.length; + } +} + +function main() { + console.log(`${new Grid().size()}`); +} +``` + +It runs (prints 2), but `a` is an array of `i64`: the IR has `alloca <{ i64, [2 x i64] }>`, although +`@CAP = private constant i32 262144` (CAP itself is stored as i32, loaded with `load i32, ptr @CAP`) +and `w` is `int`. Without CAP the same literal is `[2 x i32]`: `[0x53445750, this.w]`, +`[1, this.w]` and `[this.w, this.w]` are all i32; `[CAP, this.w]`, `[1, this.w, CAP]` and +`[0x53445750, 1, CAP]` are i64. So the shift's result type seems to widen to a 64-bit integer when +the array's element type is inferred (TypeScript gives `<<` a 32-bit result), while the constant's +storage stays i32. + +Where it bites: `Ref(header[0])` passed to a C function taking `const int*` (native_ts_graphics' +powder_sandbox_nri save header `[SAVE_MAGIC, SAVE_VERSION, this.gridW, this.gridH, CAPACITY]` with +`CAPACITY = 1 << 18`) handed it 8-byte elements, so the file's header came out as magic, 0, +version, 0, ... Workaround: annotate the array (`const header: int[] = [...]`), which gives `[5 x i32]`. From a1acec2f938f11e600cce9f18267f3f6ce67c486 Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Fri, 6 Nov 2026 18:41:21 +0000 Subject: [PATCH 3/3] TSLANG_ISSUES: 24, 25 and 26 fixed (#775) Co-Authored-By: Claude Opus 5.5 --- TSLANG_ISSUES.md | 108 +++-------------------------------------------- 1 file changed, 7 insertions(+), 101 deletions(-) diff --git a/TSLANG_ISSUES.md b/TSLANG_ISSUES.md index 033403c8e..2f60d69d0 100644 --- a/TSLANG_ISSUES.md +++ b/TSLANG_ISSUES.md @@ -5,104 +5,10 @@ should be a complete file that was run (`tslang file.ts`, JIT, Windows x64), wit ## Open -Items 1-23 (collected 2026-10-12 to pre-alpha113) are fixed or answered; their write-ups are in this -file's git history. The last two: 22 (`T | null` of a `@value` type whose only field is a class or -interface crashed the compiler, a regression from #760) was fixed by #763; 23 (`h && cond` with `h` -a `@cpp` class `| null` failed with "instanceof can't be used with a @cpp class") was fixed by #765, -regression test `tslang/test/tester/tests/00cpp_union_truth.ts`. - -### 26. `Ref(x)` of a `number` (f64) is accepted for a `Ref` parameter, passing a `double*` as `float*` - -tslang v0.0-pre-alpha115, Windows x64. Repro (compiled with `tslang -emit=llvm r.ts -o r.ll`, no -diagnostic): - -```ts -declare function Fill(enable: int, dst: Ref): int; -class A { - sensed: number[] = [0.0, 0.0, 0.0]; - run() { - Fill(1, Ref(this.sensed[0])); - print(this.sensed[0]); - } -} -function main() { const a = new A(); a.run(); } -``` - -IR: `%14 = getelementptr double, ptr %12, i32 0` then `call i32 @Fill(i32 1, ptr %14)`: the double -array's pointer goes to the `float*` parameter unchanged. A native function writing 3 floats fills -the first double with the x and y floats' bits (the double's sign and exponent come from y) and half -of the second. Expected: a type error (`Ref` isn't a `Ref`). The `Ref` declaration -is meant to type-check this; with `sensed: f32[]` the IR is `getelementptr float`, as expected. - -Where it bit: native_ts_graphics' powder_sandbox_nri, tilt gravity, `Nri_GetGravity(1, -Ref(this.sensed[0]))` with `sensed: number[]`. On a phone the gravity pointed right when held upright, -left upside down, and stayed put when held sideways. Workaround: declare the array `f32[]` (branch -powder-tilt-gravity-f32). - -### 25. `cond ? [1] : []` (an empty array literal against a non-empty one) crashes when iterated - -tslang v0.0-pre-alpha113, JIT, Windows x64. Repro (run): - -```ts -class S { - scene: int = 4; - - check(): int { - const expected = this.scene == 4 ? [1] : []; - let sum = 0; - for (const k of expected) { - sum += k; - } - return sum; - } -} - -function main() { - console.log(`${new S().check()}`); -} -``` - -It crashes (`Exception Code: 0xC0000005`) when the non-empty branch is taken. With `this.scene == 3` -(the empty branch taken) it prints 0; `cond ? [1] : [2, 3]` prints 1 and `cond ? [1, 2] : [3, 4]` -prints 3, so it's the empty literal against a non-empty one. `--emit=llvm`: the ternary's result is -`alloca <{ ptr, <{ [1 x i64] }> }>`, a tagged union (a type descriptor, `@td_..._array`, then the -array), each branch storing `<{ ptr, ptr }>` into it, rather than one array type (TypeScript gives -the expression `number[]`); `for...of` over that union is where it fails. - -Where it bites: native_ts_graphics' powder_sandbox_nri, the sound events a test scene must have, -`this.scene == 2 ? [0, 2] : (this.scene == 4 ? [1] : (this.scene == 5 ? [2, 3] : []))`, segfaulted -in scene 4 right after logging them. Workaround: `const expected: int[] = [];` and `push` the values -in `if` branches. - -### 24. An array literal holding a `const X = 1 << n` widens to 64-bit elements - -tslang v0.0-pre-alpha113, JIT and `--emit=llvm`, Windows x64. Repro (run): - -```ts -const CAP = 1 << 18; - -class Grid { - w: int = 290; - size(): int { - const a = [CAP, this.w]; - return a.length; - } -} - -function main() { - console.log(`${new Grid().size()}`); -} -``` - -It runs (prints 2), but `a` is an array of `i64`: the IR has `alloca <{ i64, [2 x i64] }>`, although -`@CAP = private constant i32 262144` (CAP itself is stored as i32, loaded with `load i32, ptr @CAP`) -and `w` is `int`. Without CAP the same literal is `[2 x i32]`: `[0x53445750, this.w]`, -`[1, this.w]` and `[this.w, this.w]` are all i32; `[CAP, this.w]`, `[1, this.w, CAP]` and -`[0x53445750, 1, CAP]` are i64. So the shift's result type seems to widen to a 64-bit integer when -the array's element type is inferred (TypeScript gives `<<` a 32-bit result), while the constant's -storage stays i32. - -Where it bites: `Ref(header[0])` passed to a C function taking `const int*` (native_ts_graphics' -powder_sandbox_nri save header `[SAVE_MAGIC, SAVE_VERSION, this.gridW, this.gridH, CAPACITY]` with -`CAPACITY = 1 << 18`) handed it 8-byte elements, so the file's header came out as magic, 0, -version, 0, ... Workaround: annotate the array (`const header: int[] = [...]`), which gives `[5 x i32]`. +Items 1-26 (collected 2026-10-12 to pre-alpha115) are fixed or answered; their write-ups are in this +file's git history. The last three, fixed by #775 (regression tests +`tslang/test/tester/tests/00tslang_issues_24_26.ts` and `ref_element_layout_error.ts`): 24 (an array +literal holding `const X = 1 << n` widened to 64-bit elements: shifts and bitwise operators now give an +`s32`, as `int` is); 25 (`cond ? [1] : []` crashed when iterated: an empty array literal now takes the +other branch's array type); 26 (`Ref(x)` of a `number` was accepted for a `Ref` parameter: a +reference to a number laid out otherwise is now an error).