Files
sdk/tests/language/closure
Ömer Ağacan 14fd3cd1fe [dart2wasm] Fix dummy initializations of cyclic types
This is another attempt at fixing #62319. See
https://dart-review.googlesource.com/c/sdk/+/470100 for the previous
attempt.

Add new member `bool get isCyclic` to `ClassInfo`: returns whether the
class has non-nullable reference cycles.

If a class has a cycle via non-nullable references, then it cannot be
dummy, because the values will need to have a cycle, but the type won't
allow late binding (as the references that form the cycle are
non-nullable).

In these cases create the locals of these types as `ref null #Top` and
use `ref.null` as the dummy values.

Generate `unreachable` in the members of un-instantiable classes, as
they can't be called.

Fixes #62319.

Issue: https://github.com/dart-lang/sdk/issues/62319
Change-Id: Iefa1949f0175eb4757fd7cfae3b25a87d17f3e8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471201
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2026-01-13 02:46:44 -08:00
..
2024-12-12 15:50:08 -08:00
2024-12-12 15:50:08 -08:00