a3953f12c7
In preparation for fixing #60490 TEST=existing Change-Id: Iad3448a30de91e62f0d60bbaa9c425bc4706c799 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421100 Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
76 lines
2.1 KiB
Plaintext
76 lines
2.1 KiB
Plaintext
library;
|
|
//
|
|
// 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 synthesized dynamic #0#0 = x;
|
|
if(#0#0 is invalid-type) {
|
|
}
|
|
}
|
|
{
|
|
final synthesized dynamic #1#0 = x;
|
|
if(#1#0 is self::A) {
|
|
}
|
|
}
|
|
{
|
|
final synthesized dynamic #2#0 = x;
|
|
if(#2#0 is self::A) {
|
|
}
|
|
}
|
|
{
|
|
final synthesized dynamic #3#0 = x;
|
|
if(#3#0 is invalid-type) {
|
|
}
|
|
}
|
|
{
|
|
final synthesized dynamic #4#0 = x;
|
|
if(#4#0 is self::A) {
|
|
}
|
|
}
|
|
{
|
|
final synthesized dynamic #5#0 = x;
|
|
if(#5#0 is self::A) {
|
|
}
|
|
}
|
|
{
|
|
final synthesized dynamic #6#0 = x;
|
|
if(#6#0 is self::A) {
|
|
}
|
|
}
|
|
}
|
|
static synthetic method _#B#new#tearOff<unrelated X extends core::Object? = dynamic>() → self::A
|
|
return new self::A::•();
|