blob: 80a1d13b5cd13651d99c9d687925a91f531e4426 [file]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/patterns/null_check_inside_if_case.dart:11:19: Warning: The null-check pattern will have no effect because the matched type isn't nullable.
// Try replacing the null-check pattern with its nested pattern.
// if (x case var y?) {}
// ^
//
// pkg/front_end/testcases/patterns/null_check_inside_if_case.dart:12:19: Warning: The null-check pattern will have no effect because the matched type isn't nullable.
// Try replacing the null-check pattern with its nested pattern.
// if (x case int y?) {}
// ^
//
// pkg/front_end/testcases/patterns/null_check_inside_if_case.dart:13:22: Warning: The null-check pattern will have no effect because the matched type isn't nullable.
// Try replacing the null-check pattern with its nested pattern.
// if (x case String y?) {}
// ^
//
import self as self;
import "dart:core" as core;
static method test1(dynamic x) dynamic {
{
dynamic y;
final dynamic #0#0 = x;
if(!(#0#0 == null) ?{core::bool} let final dynamic #t1 = y = #0#0 in true : false) {
}
}
{
core::int y;
final dynamic #1#0 = x;
if(!(#1#0 == null) ?{core::bool} #1#0 is{ForNonNullableByDefault} core::int && (let final dynamic #t2 = y = #1#0{core::int} in true) : false) {
}
}
}
static method test2(core::num x) dynamic {
{
core::num y;
final core::num #0#0 = x;
if(!(#0#0 == null) ?{core::bool} let final dynamic #t3 = y = #0#0 in true : false) {
}
}
{
core::int y;
final core::num #1#0 = x;
if(!(#1#0 == null) ?{core::bool} #1#0 is{ForNonNullableByDefault} core::int && (let final dynamic #t4 = y = #1#0{core::int} in true) : false) {
}
}
{
core::String y;
final core::num #2#0 = x;
if(!(#2#0 == null) ?{core::bool} #2#0 is{ForNonNullableByDefault} core::String && (let final dynamic #t5 = y = #2#0{core::String} in true) : false) {
}
}
}