Files
Mayank Patke 553ac951b3 [dart2js] Add indexable bits to powerset.
Change-Id: I5d4c0b4d15a05cfc30d87003785ca841c46b1a0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426583
Reviewed-by: Stephen Adams <sra@google.com>
2025-05-07 19:18:38 -07:00

118 lines
3.5 KiB
Dart

// Copyright (c) 2018, 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.
/*member: main:[null|powerset={null}]*/
main() {
ifThenNullCheck(0);
ifThenNullCheck(null);
ifThenElseNullCheck(0);
ifThenElseNullCheck(null);
ifNotThenNullCheck(0);
ifNotThenNullCheck(null);
ifNotThenElseNullCheck(0);
ifNotThenElseNullCheck(null);
ifThenNotNullComplexCheck(0, 0);
ifThenNotNullComplexCheck(null, null);
ifThenElseNotNullComplexCheck(0, 0);
ifThenElseNotNullComplexCheck(null, null);
ifThenNotNullGradualCheck1(0, 0);
ifThenNotNullGradualCheck1(null, 0);
ifThenNotNullGradualCheck2(0, 0);
ifThenNotNullGradualCheck2(null, 0);
}
/*member: ifThenNullCheck:[exact=JSUInt31|powerset={I}{O}{N}]*/
ifThenNullCheck(int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ value) {
if (value /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ ==
null) {
return 0;
}
return value;
}
/*member: ifThenElseNullCheck:[exact=JSUInt31|powerset={I}{O}{N}]*/
ifThenElseNullCheck(
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ value,
) {
if (value /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ ==
null) {
return 0;
} else {
return value;
}
}
/*member: ifNotThenNullCheck:[exact=JSUInt31|powerset={I}{O}{N}]*/
ifNotThenNullCheck(
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ value,
) {
if (value /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ !=
null) {
return value;
}
return 0;
}
/*member: ifNotThenElseNullCheck:[exact=JSUInt31|powerset={I}{O}{N}]*/
ifNotThenElseNullCheck(
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ value,
) {
if (value /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ !=
null) {
return value;
} else {
return 0;
}
}
/*member: ifThenNotNullComplexCheck:[exact=JSUInt31|powerset={I}{O}{N}]*/
ifThenNotNullComplexCheck(
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ a,
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ b,
) {
if (a /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ != null &&
a /*invoke: [exact=JSUInt31|powerset={I}{O}{N}]*/ != b) {
return a;
}
return 0;
}
/*member: ifThenElseNotNullComplexCheck:[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/
ifThenElseNotNullComplexCheck(
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ a,
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ b,
) {
if (a /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ != null &&
a /*invoke: [exact=JSUInt31|powerset={I}{O}{N}]*/ != b) {
return a;
}
return a;
}
/*member: ifThenNotNullGradualCheck1:[exact=JSUInt31|powerset={I}{O}{N}]*/
ifThenNotNullGradualCheck1(
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ a,
int /*[exact=JSUInt31|powerset={I}{O}{N}]*/ b,
) {
if (a /*invoke: [null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ != b) {
if (a /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ != null) {
return a;
}
}
return 0;
}
/*member: ifThenNotNullGradualCheck2:[exact=JSUInt31|powerset={I}{O}{N}]*/
ifThenNotNullGradualCheck2(
int? /*[null|exact=JSUInt31|powerset={null}{I}{O}{N}]*/ a,
int /*[exact=JSUInt31|powerset={I}{O}{N}]*/ b,
) {
if (a /*invoke: [null|subclass=JSInt|powerset={null}{I}{O}{N}]*/ != null) {
if (a /*invoke: [exact=JSUInt31|powerset={I}{O}{N}]*/ != b) {
return a;
}
}
return 0;
}