Skip to content

Commit

Permalink
[test][wildcard-variables] Fix typedef record type.
Browse files Browse the repository at this point in the history
This switch would've failed regardless. This CL switches the types of the typedef R so that this test would pass.

Bug: #55652
Change-Id: Ic36863a38e3197bd9012907caa9f445faf4945b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371021
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
  • Loading branch information
kallentu authored and Commit Queue committed Jun 12, 2024
1 parent bbc9cb6 commit 0b31d88
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import 'dart:async';

import 'package:expect/expect.dart';

typedef R = (String _, String _);
typedef R = (int _, int _);

void main() {
(int _, int _) record;
record = (1, 2);
Expect.equals(1, record.$1);
Expect.equals(2, record.$2);

R rType = ('1', '2');
Expect.equals('1', rType.$1);
Expect.equals('2', rType.$2);
R rType = (1, 2);
Expect.equals(1, rType.$1);
Expect.equals(2, rType.$2);

// Has a named field (which cannot be `_`).
(int _, int _, {int x}) recordX;
Expand Down

0 comments on commit 0b31d88

Please sign in to comment.