blob: 3d4b8f57fff4ae6aedfbf7737b650e6a67d249f8 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'null'.
// switch (a) {
// ^
//
// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'A.b'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'A.b'.
// switch (a) {
// ^
//
// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases since it doesn't match 'B.b'.
// - 'B' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'B.b'.
// switch (b) {
// ^
//
// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'null'.
// switch (c) {
// ^
//
// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'C.b'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'C.b'.
// switch (c) {
// ^
//
// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases since it doesn't match 'D.b'.
// - 'D' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'D.b'.
// switch (d) {
// ^
//
import self as self;
import "dart:core" as core;
import "dart:_internal" as _in;
import "main_lib.dart" as mai;
import "org-dartlang-testcase:///main_lib.dart";
class A extends core::_Enum /*isEnum*/ {
static const field core::List<self::A> values = #C7;
enum-element static const field self::A a = #C3;
enum-element static const field self::A b = #C6;
const constructor •(core::int #index, core::String #name) → self::A
: super core::_Enum::•(#index, #name)
;
method _enumToString() core::String
return "A.${this.{core::_Enum::_name}{core::String}}";
}
class B extends core::_Enum /*isEnum*/ {
static const field core::List<self::B> values = #C10;
static const field self::B c = #C8;
enum-element static const field self::B a = #C8;
enum-element static const field self::B b = #C9;
const constructor •(core::int #index, core::String #name) → self::B
: super core::_Enum::•(#index, #name)
;
method _enumToString() core::String
return "B.${this.{core::_Enum::_name}{core::String}}";
}
static method a1(self::A? a) core::int? {
#L1:
switch(a) /*isExplicitlyExhaustive*/ {
#L2:
case #C3:
{
return 0;
}
#L3:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method a2(self::A? a) core::int? {
#L4:
switch(a) /*isExplicitlyExhaustive*/ {
#L5:
case #C11:
{
return null;
}
#L6:
case #C3:
{
return 0;
}
#L7:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method b1(self::B b) core::int {
#L8:
switch(b) /*isExplicitlyExhaustive*/ {
#L9:
case #C8:
{
return 0;
}
#L10:
case #C9:
{
return 1;
}
#L11:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method b2(self::B? b) core::int? {
#L12:
switch(b) /*isExplicitlyExhaustive*/ {
#L13:
case #C11:
{
return null;
}
#L14:
case #C8:
{
return 0;
}
#L15:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method c1(mai::C? c) core::int? {
#L16:
switch(c) /*isExplicitlyExhaustive*/ {
#L17:
case #C12:
{
return 0;
}
#L18:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method c2(mai::C? c) core::int? {
#L19:
switch(c) /*isExplicitlyExhaustive*/ {
#L20:
case #C11:
{
return null;
}
#L21:
case #C12:
{
return 0;
}
#L22:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method d1(mai::D d) core::int {
#L23:
switch(d) /*isExplicitlyExhaustive*/ {
#L24:
case #C13:
{
return 0;
}
#L25:
case #C14:
{
return 1;
}
#L26:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method d2(mai::D? d) core::int? {
#L27:
switch(d) /*isExplicitlyExhaustive*/ {
#L28:
case #C11:
{
return null;
}
#L29:
case #C13:
{
return 0;
}
#L30:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch statement with a non-nullable type.");
}
}
static method test() void {
self::a1(#C6);
self::a2(#C6);
self::b1(#C9);
self::b2(#C9);
self::c1(#C15);
self::c2(#C15);
self::d1(#C14);
self::d2(#C14);
}
constants {
#C1 = 0
#C2 = "a"
#C3 = self::A {index:#C1, _name:#C2}
#C4 = 1
#C5 = "b"
#C6 = self::A {index:#C4, _name:#C5}
#C7 = <self::A*>[#C3, #C6]
#C8 = self::B {index:#C1, _name:#C2}
#C9 = self::B {index:#C4, _name:#C5}
#C10 = <self::B*>[#C8, #C9]
#C11 = null
#C12 = mai::C {index:#C1, _name:#C2}
#C13 = mai::D {index:#C1, _name:#C2}
#C14 = mai::D {index:#C4, _name:#C5}
#C15 = mai::C {index:#C4, _name:#C5}
}
Constructor coverage from constants:
org-dartlang-testcase:///main.dart:
- A. (from org-dartlang-testcase:///main.dart:7:6)
- _Enum. (from org-dartlang-sdk:///sdk/lib/core/enum.dart)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart)
- B. (from org-dartlang-testcase:///main.dart:9:6)