Skip to content

Commit

Permalink
[tests] Update the error test results for wildcard variables.
Browse files Browse the repository at this point in the history
Update each error test for wildcard variables with their proper expectations.

Bug: #55652
Change-Id: I2c1e2716f501354afcbb9b5297beb854c3a9598a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381309
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
  • Loading branch information
kallentu authored and Commit Queue committed Aug 20, 2024
1 parent 79e8869 commit 3719485
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ void main() {

/*indent*/ _();
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION
// [cfe] Method not found: '_'.
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ main() {

_.topLevel;
//^
// [analyzer] unspecified
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Undefined name '_'.

_.C(value);
//^
// [analyzer] unspecified
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Undefined name '_'.

// Private extensions can't be used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ class C {
var other;

C(this._) : other = _;
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
// [cfe] Can't access 'this' in a field initializer to read '_'.
}

class CWithTypeParameter<_> {
var _;
var other;

CWithTypeParameter(this._) : other = _;
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
// [cfe] Can't access 'this' in a field initializer to read '_'.
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class C {
var _;

C(this._, this._);
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER
// [cfe] '_' was already initialized by this constructor.

C.named(this._, this._);
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER
// [cfe] '_' was already initialized by this constructor.
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@

void genericFunction<_ extends void Function<_>(_, _), _>() {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CLASS
// [cfe] Type '_' not found.
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CLASS
// [cfe] Type '_' not found.

0 comments on commit 3719485

Please sign in to comment.