Commit Graph

3261 Commits

Author SHA1 Message Date
Johnni Winther 5baa4af7d8 [analyzer,cfe] Add 'views' feature and support for 'view class'
This adds the 'views' feature flag together with parser support
for 'view class'. If the feature is not enabled, an error is reported.

TEST=pkg/front_end/parser_testcases/views/...

Change-Id: I813ac86a0e7de9f0a5729c6d7ae35b82d1258ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265780
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-11-02 11:09:59 +00:00
Konstantin Shcheglov 3cd43b3aac Duplicate tests with 'switch' statements, to run them with experiments, and with language 2.18 - without.
Change-Id: I003fedc102ef044ff8b58883ad1fbfa702dbdd00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266780
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-10-31 22:31:15 +00:00
Konstantin Shcheglov bcdd9c4fba Use FooImpl in BarElementImpl, interface element children and top-level declarations.
Change-Id: I22973b86a72c29e096b78687f19846a6063acb83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266480
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-28 21:18:26 +00:00
Konstantin Shcheglov ce591144b0 Move a few ForStatement tests.
Change-Id: I972f9162d456c1a62c6bf9a7b5e645a52a214ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266444
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-28 19:10:48 +00:00
Sam Rawlins 9896f1c647 Enable the unnamed-libraries experiment by default in 2.19.0
TEST=tests/language/library/unnamed_library_test.dart

Bug: https://github.com/dart-lang/language/issues/1073
Change-Id: I1c7fa7b4ee4450e344a7613525765e4ab590cc8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265381
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-10-25 21:10:57 +00:00
Konstantin Shcheglov f42bb9dffc Support for replacing WhenClauseImpl.expression
Change-Id: I0e19b5bdbc32b77ccb29bb40ffd8191c04ffa208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264728
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-18 22:39:49 +00:00
Konstantin Shcheglov 138c956bcd Parse CaseClause for IfElement.
Change-Id: Id0ea8da51b3492768d734884fee43d913f9c69ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-18 18:30:39 +00:00
Paul Berry 5e29849393 Parser: consolidate handleCaseMatch and endCaseExpression.
There was no need for both of these listener callbacks, because they
were always called together.  Since `beginCaseExpression` is actually
used, it makes sense to keep `endCaseExpression` and get rid of
`handleCaseMatch`.

Change-Id: I544096b2c2b2814e8cc0c8606455855cb77c9e60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264102
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-15 13:51:59 +00:00
Paul Berry 9aab3c7746 Patterns parsing: add support for guards.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I21db09c9d8c1d359e1b125eea2bae2749cdb72fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264101
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-14 20:14:20 +00:00
Paul Berry 4cf63fb382 Parser and listener API changes for supporting pattern guards.
These are in their own CL so that it's easy to verify that no
functionalty has changed, even though a lot of parser expectations
files are affected.

In a follow-up CL, I'll add code that actually parses pattern guards.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I79f5a02df45e29b69aa4d8348cfdf27042ada9d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264020
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-14 15:42:12 +00:00
Paul Berry 5923b883db Parser: add support for wildcard patterns.
The bare identifier `_` is treated as a variable pattern wherever it
appears, even though other bare identifiers are sometimes treated as
constant patterns.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I475ef627b6d0bf519a1972aa5ec683e2d032f02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263280
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-14 14:04:59 +00:00
Ahmed Ashour ecb992586a [analyzer] change range of dead code of the RHS of binary operator
Bug: #43511
Change-Id: I1b1562c0262101900dabea3544bfc28293d5c7f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260109
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-10 21:07:42 +00:00
Jens Johansen e860cf241b [parser] Empty record
https://github.com/dart-lang/language/pull/2535

Change-Id: I8241119ee858ce39673472056b88c9393799e1a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262600
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-10-06 06:34:58 +00:00
Konstantin Shcheglov 7de6c03e57 Update a few pattern tests that can resolve now.
Change-Id: I7d19dfde6a5d15e88f0d72f032734fc0686395f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-10-05 22:25:42 +00:00
Konstantin Shcheglov ca709d09db Resolve RelationalPattern.
Change-Id: Ic390c0c760fbcfb91384bf4c9d5a0981483b0f27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262844
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-05 21:51:38 +00:00
Paul Berry afa257f53d Patterns parsing: fix the name of one more test.
Change-Id: I106f3eaed7cc15badb8594188f272778a1036bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-05 19:31:16 +00:00
Konstantin Shcheglov 683e2419da Deprecate 'DartType.element2' use 'element' instead.
Change-Id: I6986a058616db489987789cfab09d53a450e3ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262666
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-05 16:30:09 +00:00
Konstantin Shcheglov 97661ec1e3 Include 'constKeyword' into ConstantPatternImpl.childEntities
Change-Id: I40c874a4d4381aaf4748b86c6c20e84b9942d712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262507
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-04 16:06:28 +00:00
Konstantin Shcheglov fcc9473dab Deprecate CatchClause.exceptionParameter2/stackTraceParameter2
Change-Id: I3f0ae9367f35fe514a125cb0f06ccbdc8fa0dc18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262502
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-04 15:58:11 +00:00
Konstantin Shcheglov 2a43b37898 Replace ExtractorPattern.typeName/typeArguments with 'NamedType get type'.
Change-Id: Iaa19aef8f2cb8727879b0eea41c6f8220205f226
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262501
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-04 00:35:51 +00:00
Ahmed Ashour 6da33ae60f [analyzer] add HintCode.DUPLICATE_EXPORT
Fixes #49439

Change-Id: I511205c6b0960f6b19a2ac45211bc1348568f52c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 23:22:18 +00:00
Konstantin Shcheglov bcd9da806b Use assertParsedNodeText() for PatternsTest.
Change-Id: Ib0e301d6b5b5c51fe16db13cc27ed900dffb89a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 22:01:49 +00:00
Konstantin Shcheglov 8a5725ad38 Deprecate 'Directive.element2', use 'element' instead.
Change-Id: I2326b43381d1d3f84d74f69409bc688516f6a0d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262500
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 21:10:58 +00:00
Paul Berry 118f628ecf Patterns: add support for parsing constant patterns
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I601248bc206d9b19521b020fadb2eccd048e0ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261701
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 19:46:16 +00:00
Paul Berry 06847c34fb Adjust patterns parsing tests to follow analyzer conventions
See test naming conventions here:
https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/doc/implementation/tests.md

This is a rename-only change; this is not clear from the diff due to
sort order changes.

Change-Id: Ia84ca7b188f4bb21f8cfce60e037be792adcdc87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262022
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-02 16:38:50 +00:00
Brian Wilkerson 3616bd5992 Enable the patterns feature in parser-based tests
Change-Id: I0c2db4540d1868af02d4b1a067d027dad93f92b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261444
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-27 21:33:55 +00:00
Danny Tuppeny d83cb4e621 [analysis_server] Fix some issues with requests made at an offset between name and type/parameter lists
Removal AstNodes for names in declarations left some of these places getting FormalParameterList/TypeParameterLists when an offset was between the name and parameter list. This is a fairly common case if you double-click to select a name in VS Code (it sends the end of the name as the offset).

This only changes the case where a single offset is provided (not a range), and it is both the start of the parameter list and the end of the name.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4157.

Change-Id: I1219fa70b0795b61c60f31ad61ff9a34954c8b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-27 17:13:53 +00:00
Paul Berry 6945a72009 Patterns: initial parser support.
The parser now supports the following subset of the parser grammar:

- logical-or and logical-and patterns (called "binary patterns" to
  reflect analyzer nomenclature)

- extractor patterns

- cast patterns

- list patterns

- map patterns

- null-assert patterns

- null-check patterns

- variable patterns where the variable is preceded by `var`, `final`,
  <type>, or `final <type>`

- if-case statements (and if-case within collections); without guards

- record patterns

- parenthesized patterns

- constant patterns where the constant is a plain expression not
  beginning with `const` (booleanLiteral, nullLiteral, numericLiteral,
  stringLiteral, identifier, or qualifiedName).

- relational patterns

- patterns in switch statements

- integration with the analyzer's AstBuilder class

Not implemented yet:

- constant patterns beginning with `const`

- variable patterns where the variable is a single identifier (note:
  this means that `_` is currently interpreted as a constant pattern
  rather than a "wildcard" variable pattern)

- guards (a.k.a. "when clauses")

- switch expressions

- pattern variable declarations

- patterns appearing in "for loop parts"

- pattern assignment

- several error checking and error recovery scenarios (see TODO
  comments)

- integration with the front_end's BodyBuilder class

- front_end style parser tests (currently the feature is tested using
  analyzer unit tests only)

Note that in patterns, `as` binds has higher precedence than `&` and
`|`, whereas in expressions, `&` and `|` have higher precedence than
`as`.  To reflect this, a new precedence has been added,
CAST_PATTERN_PRECEDENCE.

To reduce the risk to users during parser development, the parser
currently only attempts to parse patterns when instructed to do so
(i.e. when the language feature is enabled).  In the long term, I
intend to change the parser so that it always attempts to parse
patterns, and it is the responsibility of its listener to report
errors if patterns are used without enabling the language feature.

Change-Id: I360b535d2a6ebd35a0ee4d066b06e3ae8e3121ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-09-27 13:16:33 +00:00
Konstantin Shcheglov 745d0ff64a Deprecate 'Element.enclosingElement3', use 'enclosingElement'.
Change-Id: I6f4fd7e8c0f071bde10cb5e57ed6195ae517e575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-26 23:58:14 +00:00
Konstantin Shcheglov 2e380ff2ff Issue 50045. Special case bool.fromEnvironment('dart.library.js_util') to return unknown.
Ideally, all `bool.fromEnvironment()` should return "unknown".
But we have issues with making it to be compatible with Andular Dart.
At least at the moment.
So, to unblock Flutter people working on a new platform, we need this.

Bug: https://github.com/dart-lang/sdk/issues/50045
Change-Id: I088a5b822f495d7258ceb1fdeee8f0b8a6a9e120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-26 20:32:47 +00:00
Konstantin Shcheglov 44316060f1 Deprecate 'get declaredElement2', use 'get declaredElement' instead.
Change-Id: Ida7a9c2ac35943aed2d75f81f98ce7056b616aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260741
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-23 20:05:29 +00:00
Sam Rawlins 51114fca8a Unnamed libraries
Fixes https://github.com/dart-lang/language/issues/1073

Spec: https://github.com/dart-lang/language/blob/master/accepted/future-releases/unnamed-libraries/feature-specification.md

This work allows library directives without a name. Every single one would look like this:

```
library;
```

:) it was a little anti-climactic implementing a non-feature like this, but there it is.

The affordance for a library directive without a name is guarded by an experiment flag, `--unnamed-libraries`.

Change-Id: I8612238359e88d6082f7e89d0d0fc624fdb45273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257490
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-09-23 05:37:39 +00:00
Konstantin Shcheglov e03170035a Deprecate 'get name2', use 'get name' instead.
Change-Id: Iee8ef5fb6700d96c857a22a99dc61dac3da88572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-22 02:22:47 +00:00
Konstantin Shcheglov 126d79e27a Use named parameters for a few AST nodes.
Change-Id: Iee8edcca9ae38e34e39a4156d5488f53fecbf0ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-21 15:45:56 +00:00
Konstantin Shcheglov 139344eb28 Support for RecordState in DartObjectPrinter.
Change-Id: I44481daa436916841620491529178036fc46456a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-20 16:05:05 +00:00
Konstantin Shcheglov 3945c9aa71 Use builders in AstBuilder to build ClassDeclarationImpl, etc.
Relatved to https://dart-review.googlesource.com/c/sdk/+/259020

The goal is to avoid the need to update NodeListImpl.
I'm not 100% sure that we can fully achieve this, there is at least
one more place with switch / case.

Change-Id: Ic7468a7b9ded817b3315902cefdeaa7428ec6857
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-13 18:30:27 +00:00
Konstantin Shcheglov 6f0fe880c4 Breaking changes for analyzer version 5.0.0
Reland of https://dart-review.googlesource.com/c/sdk/+/243164

Change-Id: I5167844ea1001f026cf8d9b82465a79f560d188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257267
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-07 16:27:18 +00:00
Sam Rawlins 1089fa528a Remove unused code in analyzer tests
Change-Id: I791d3f53916f164b3ae061b894b35799146675ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-09-06 14:45:37 +00:00
Konstantin Shcheglov ff8024fc78 Revert "Breaking changes for analyzer version 5.0.0"
This reverts commit d8df88cbe4.

Reason for revert: breaks Flutter HHH, requires updates to linter

Original change's description:
> Breaking changes for analyzer version 5.0.0
>
> Change-Id: Id9f27b6c41829249f6b2e7b93ad396643193fc78
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243164
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: I6ca213427189c169ddacbd89f60d463efa2c38f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257122
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-31 21:05:19 +00:00
Konstantin Shcheglov d8df88cbe4 Breaking changes for analyzer version 5.0.0
Change-Id: Id9f27b6c41829249f6b2e7b93ad396643193fc78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243164
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-31 05:08:50 +00:00
Brian Wilkerson 711ec5e387 Record the const keyword for record literals
Change-Id: I0e85efa2634488a4c4f0529daf3a0e10a1ca06a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256922
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-30 19:00:02 +00:00
Jens Johansen a4352d09e1 [parser] Record literals can be const and one-element only
This should bring parsing of record literals up-to-date with v1.6 of
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md

Change-Id: If39bb1834137da55ef8bd1923106bbc614ea319b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256461
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-08-30 10:54:08 +00:00
Konstantin Shcheglov b2b50f7fc6 Make RecordTypeImpl structured, without elements.
Change-Id: I7e06c728037f2b94609165394a40388979269cc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-25 19:47:03 +00:00
Konstantin Shcheglov 66c09b2fd2 Update ReplacementVisitor to support RecordType.
Change-Id: I4ada89fc87709dd15f2add86005d6c8927d7b773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255684
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 20:09:44 +00:00
Konstantin Shcheglov c9febdd4e3 Update display string for promoted type parameter type.
Bug: https://github.com/dart-lang/sdk/issues/49692
Change-Id: I4f61dfe9bb123f000cb253f14a0733063f16acde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255547
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 17:26:34 +00:00
Brian Wilkerson 6f92ce778a Implement AstBuilder support for record literals
Change-Id: I54f7a04d240f613185d5b114802fb1da4f974269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-16 21:03:12 +00:00
Konstantin Shcheglov ba633b92c0 Extract AbstractTypeSystemTest into type_system_base.dart
Change-Id: I9b98dab72de5c97923bbcf361c9482129700aefd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255320
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-16 18:26:22 +00:00
Konstantin Shcheglov b9f0b2ed8b Implementations for RecordTypeAnnotation nodes.
Change-Id: Ice4425e70b62fc68d4ad3aa97faf6e56f4076781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255144
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 22:35:26 +00:00
Brian Wilkerson 65058f87e1 Add visitor support for record literals
Change-Id: I8f5aff11786a75ce02a8f3483585dc0513ae2c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255142
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-15 20:00:46 +00:00
Konstantin Shcheglov c66faf9f3a RecordElement.instantiate(), substitution, type alias.
Change-Id: Icd0e234e57d17a1c86140ed58fc9732da31bf1b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254942
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 17:31:36 +00:00