[dart2wasm] Ensure the field in BoxedBool is non mutable

Change-Id: Idfa251e647f9d0205086d17334103a511366df7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501460
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This commit is contained in:
Martin Kustermann
2026-05-07 04:05:45 -07:00
parent a6ec5cee79
commit 0f9ce46c6d
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
(type $Array<Object?> (array (field (mut (ref null $#Top)))))
(type $BoxedBool (sub final $#Top (struct
(field $field0 i32)
(field $value (mut i32)))))
(field $value i32))))
(type $BoxedInt (sub final $#Top (struct
(field $field0 i32)
(field $value i64))))
+5 -4
View File
@@ -2,14 +2,15 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:_wasm';
@pragma("wasm:entry-point")
final class BoxedBool extends bool {
// A boxed bool contains an unboxed bool.
@pragma("wasm:entry-point")
bool value = false;
final WasmI32 value;
/// Dummy factory to silence error about missing superclass constructor.
external factory BoxedBool();
@pragma("wasm:entry-point")
external BoxedBool();
@override
bool operator ==(Object other) {