blob: 007a8442885518e730f7ee3964bc1d9dfda26c18 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/patterns/object_pattern_errors.dart:12:14: Error: Expected 0 type arguments.
// if (x case A<int>()) {} // Error.
// ^
//
// pkg/front_end/testcases/patterns/object_pattern_errors.dart:15:14: Error: Expected 1 type arguments.
// if (x case B<String, num>()) {} // Error.
// ^
//
// pkg/front_end/testcases/patterns/object_pattern_errors.dart:16:16: Error: The getter name is not specified explicitly, and the pattern is not a variable. Try specifying the getter name explicitly, or using a variable pattern.
// if (x case A(: 5)) {} // Error
// ^
//
// pkg/front_end/testcases/patterns/object_pattern_errors.dart:17:16: Error: A pattern field in an object pattern must be named.
// Try adding a pattern name or ':' before the pattern.
// if (x case A(5)) {} // Error
// ^
//
// pkg/front_end/testcases/patterns/object_pattern_errors.dart:18:20: Error: A pattern field in an object pattern must be named.
// Try adding a pattern name or ':' before the pattern.
// if (x case A(var a)) {} // Error
// ^
//
import self as self;
import "dart:core" as core;
typedef B<unrelated X extends core::Object? = dynamic> = self::A;
class A extends core::Object {
field core::int? field = null;
synthetic constructor •() self::A
: super core::Object::•()
;
}
static method test(dynamic x) dynamic {
{
final dynamic #0#0 = x;
if(#0#0 is{ForNonNullableByDefault} invalid-type) {
}
}
if(true) {
}
if(true) {
}
if(true) {
}
if(true) {
}
if(true) {
}
if(true) {
}
}
static method _#B#new#tearOff<unrelated X extends core::Object? = dynamic>() → self::A
return new self::A::•();