Files
sdk/pkg/compiler/test/inference/data/assert_initializer.dart
T
Mayank Patke d0e09ea091 [dart2js] Print powerset value in typemask toString methods.
We may find it useful later to add a more verbose stringification that
writes out the properties expressed by the powerset. For now, just
printing the int value is sufficient to debug e.g. test failures, and
it's relatively straightforward to manually convert an int to a set of
properties by looking at the definitions of the powerset domains.

Change-Id: I2397ffd83a6e86830f67c7f1ef811e33c0b7ff3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405567
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-07 04:20:04 -08:00

26 lines
903 B
Dart

// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// 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.
class X {
/*member: X.a:Union([exact=JSExtendableArray|powerset=0], [exact=JSString|powerset=0], powerset: 0)*/
final dynamic a;
/*member: X.:[exact=X|powerset=0]*/
X(
Object /*Union([exact=JSExtendableArray|powerset=0], [exact=JSString|powerset=0], powerset: 0)*/
value,
) : assert(value is String),
a = value;
}
/*member: main:[null|powerset=1]*/
main() {
X('a')
. /*[exact=X|powerset=0]*/ a
. /*Union([exact=JSExtendableArray|powerset=0], [exact=JSString|powerset=0], powerset: 0)*/ length;
X([1])
. /*[exact=X|powerset=0]*/ a
. /*Union([exact=JSExtendableArray|powerset=0], [exact=JSString|powerset=0], powerset: 0)*/ length;
}