Skip to content

Conversation

@sgrekhov
Copy link
Contributor

@sgrekhov sgrekhov commented Jan 5, 2023

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I considered patterns in a declaration context, and I believe we can have a test for that, too:

An _ in a declaration context is a wildcard (not a variable pattern introducing a variable named _), and it is also possible to use an object pattern in a declaration context. So we should be able to do something like this:

var SomeClass(v1: _, v2: x) = SomeClass(3, 4);

Yes, it's silly (we don't have to look up the value of v1, so we don't really need a mechanism that will allow us to look it up and then ignore it), but it could be used to look up the value of v1 and perform a type cast on it in order to have a dynamic error if it doesn't have that type. So it doesn't have to be silly in all scenarios to have a wildcard in a declaration.

@sgrekhov sgrekhov requested a review from eernstg January 11, 2023 11:41
@sgrekhov
Copy link
Contributor Author

Added LanguageFeatures/Patterns/object_A07_t06.dart

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eernstg eernstg merged commit b18d74e into dart-lang:master Jan 11, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Jan 13, 2023
2023-01-12 [email protected] Fixes dart-lang/co19#1702. wildcards_A01_t01.dart. Use correct types in list pattern (dart-lang/co19#1728)
2023-01-12 [email protected] Fixes dart-lang/co19#1708. Specify type of the list pattern (dart-lang/co19#1733)
2023-01-12 [email protected] Fixes dart-lang/co19#1681. Improve object pattern testing in a pattern assignment (dart-lang/co19#1735)
2023-01-12 [email protected] Fixes dart-lang/co19#1740. constant_A03_t05.dart. Typo fixed (dart-lang/co19#1749)
2023-01-12 [email protected] Fixes dart-lang/co19#1744. object_A01_t05.dart fixed not to fail in a weak mode (dart-lang/co19#1752)
2023-01-12 [email protected] Fixes dart-lang/co19#1745. switch_statement_A04_t01.dart. Typo fixed (dart-lang/co19#1753)
2023-01-12 [email protected] Fixes dart-lang/co19#1746. switch_statement_A07_t02.dart. Change type in cast pattern to Object (dart-lang/co19#1754)
2023-01-12 [email protected] Fixes dart-lang/co19#1747. variable_A02_t01.dart. Fix expected result for map pattern (dart-lang/co19#1755)
2023-01-12 [email protected] Fixes dart-lang/co19#1748. variable_A02_t04.dart. Typo fixed (dart-lang/co19#1756)
2023-01-12 [email protected] dart-lang/co19#1401. [Patterns] cast, null-assert and null-check patterns tests added (dart-lang/co19#1537)
2023-01-12 [email protected] Fixes dart-lang/co19#1629. Logical and pattern tests fixed (dart-lang/co19#1757)
2023-01-12 [email protected] Fixes dart-lang/co19#1743. Convert double value to int (dart-lang/co19#1751)
2023-01-11 [email protected] Fixes dart-lang/co19#1709. Error expectations updated for CFE (dart-lang/co19#1736)
2023-01-11 [email protected] dart-lang/co19#1401. [Patterns] Object pattern test added (dart-lang/co19#1652)
2023-01-11 [email protected] Fixes dart-lang/co19#1699. variable_A01_t01.dart. Fix types used in a list pattern (dart-lang/co19#1725)
2023-01-11 [email protected] Fixes dart-lang/co19#1734. Expect a static warning in case of not-necessary null-check/assert (dart-lang/co19#1738)
2023-01-11 [email protected] dart-lang/co19#1737. Roll failures fixed (dart-lang/co19#1739)
2023-01-10 [email protected] Fixes dart-lang/co19#1682. pattern_assignment_A21_t01.dart. Use dynamic instead of Record class (dart-lang/co19#1710)
2023-01-10 [email protected] Fixes dart-lang/co19#1683. pattern_assignment_A05_t04.dart. Use record type instead of Record class (dart-lang/co19#1711)
2023-01-10 [email protected] Fixes dart-lang/co19#1684. Use record type instead of Record class, add missing `late` keywords (dart-lang/co19#1712)
2023-01-10 [email protected] dart-lang/co19#1686. Expect runtime error in case of cast pattern (dart-lang/co19#1713)
2023-01-10 [email protected] Fixes dart-lang/co19#1688. record_A02_t09.dart. Fix typo (dart-lang/co19#1714)
2023-01-10 [email protected] Fixes dart-lang/co19#1689. relational_A03_t01.dart. Fix typo (dart-lang/co19#1715)
2023-01-10 [email protected] Fixes dart-lang/co19#1690. relational_A04_t04.dart. Fix typo (dart-lang/co19#1716)
2023-01-10 [email protected] Fixes dart-lang/co19#1691. relational_A05_t01.dart. Remove wrong checks (dart-lang/co19#1717)
2023-01-10 [email protected] Fixes dart-lang/co19#1692. Add missed 'const' statements (dart-lang/co19#1718)
2023-01-10 [email protected] Fixes dart-lang/co19#1693. switch_expression_A02_t01.dart. Fix typos (dart-lang/co19#1719)
2023-01-10 [email protected] Fixes dart-lang/co19#1694. switch_expression_A03_t05.dart. Fix return type (dart-lang/co19#1720)
2023-01-10 [email protected] Fixes dart-lang/co19#1695. switch_expression_A03_t12.dart. Add missed `abstract` keyword (dart-lang/co19#1721)
2023-01-10 [email protected] Fixes dart-lang/co19#1696. switch_expression_A04_t01.dart. Fix expected errors positions (dart-lang/co19#1722)
2023-01-10 [email protected] Fixes dart-lang/co19#1697. switch_expression_A06_t01.dart. Fix test errors and typos (dart-lang/co19#1723)
2023-01-10 [email protected] Fixes dart-lang/co19#1698. switch_expression_A06_t02.dart. Fix typo (dart-lang/co19#1724)
2023-01-10 [email protected] Fixes dart-lang/co19#1700. variable_A02_t02.dart. Expect additional errors (dart-lang/co19#1726)
2023-01-10 [email protected] Fixes dart-lang/co19#1701. variable_A02_t06.dart. Fix typos (dart-lang/co19#1727)
2023-01-10 [email protected] Fixes dart-lang/co19#1703. wildcards_A01_t02.dart. Don't use wildcard as a map key (dart-lang/co19#1729)
2023-01-10 [email protected] Fixes dart-lang/co19#1704. wildcards_A01_t03.dart. Use dynamic to avoid compile-time error (dart-lang/co19#1730)
2023-01-10 [email protected] Fixes dart-lang/co19#1705. Records/on_clauses_A02_t05.dart. Add missed error expectation (dart-lang/co19#1731)
2023-01-10 [email protected] Fixes dart-lang/co19#1706. Fix typos in map pattern tests (dart-lang/co19#1732)
2023-01-10 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 3.2.0 to 3.3.0 (dart-lang/co19#1707)

Change-Id: I59ffc2e275994159fe8807bc7f0b0900c65759db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279002
Reviewed-by: Alexander Thomas <[email protected]>
@sgrekhov sgrekhov deleted the co19-1401-11 branch March 22, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants