Johnni Winther
d07d8f59fc
[cfe] Support inline class constructor tear-off
...
Closes #52240
Change-Id: If3474b85f1ebcdd5d0f4e68eafd4f706b7fd38fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301386
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-05-04 12:33:58 +00:00
Johnni Winther
8cc76bde6e
[cfe] Support type inference on inline class constructor invocation
...
Closes #51146
Change-Id: I8fab2e999b29fbc811786e168d0e7a4c5a081418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295363
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-04-24 10:17:54 +00:00
Johnni Winther
fe01a2068d
[cfe] Implement least upper bound for inline types
...
Closes #51556
Change-Id: I44f2ae947b5316d21d23b39b88f1515702525955
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294983
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
2023-04-24 09:14:07 +00:00
Oleh Prypin
47cfe5f97f
Roll dart_style into the SDK
...
Includes just one more commit - "Enable support for inline class syntax"
Change-Id: Ie230fc72b7170d3610bdd7ed7ab8c193338f8a93
Bug: b/271244238
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287020
Commit-Queue: Oleh Prypin <oprypin@google.com >
Reviewed-by: Slava Egorov <vegorov@google.com >
Auto-Submit: Oleh Prypin <oprypin@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
2023-03-07 16:29:09 +00:00
Ahmed Ashour
1a362fa011
[cfe] fix the export of inline class
...
Bug: #51516
Change-Id: I56d61125b4a9cba55f94e15dbd82289c4fd42214
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285262
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-03-02 13:36:43 +00:00
Johnni Winther
fa0eb1eeec
[cfe] Support implements clause on inline classes
...
Closes #51445
TEST=pkg/front_end/testcases/inline_class/implements.dart
Change-Id: I1214afd8fe8f87ca516be018129e1629c91af289
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284704
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
2023-02-23 08:07:44 +00:00
Konstantin Shcheglov
67e7c96962
Fix parser to use correct begin token, to get documentation comments from it.
...
Change-Id: I9505353c9c6c00082e588aced34e8151c7ab22b7
Bug: https://github.com/dart-lang/sdk/issues/51447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284441
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-02-22 17:03:38 +00:00
Ahmed Ashour
8ef5104d05
[cfe] create a Procedure
...
with a distinction between `inlineClassMember` and `extensionMember`.
Fixes #51338
Change-Id: I169c285537754137d5b32effc9697c2b9f4eb5c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283864
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-02-22 08:03:38 +00:00
Ahmed Ashour
28f69d5bd3
[cfe] inline class to handle annotations in constructors
...
Fixes #51397
Change-Id: I3454d1ce2f80567c57a781a485897bf795701696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283041
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-02-16 19:32:11 +00:00
Ahmed Ashour
560abd0c9d
[cfe] handle inline class constructor
...
with formal parameters
Fixes #51277
Change-Id: I76cfe3e8017f8124a5ac014348459d5b276cbebe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281682
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-02-09 12:22:00 +00:00
Johnni Winther
404fbe553b
[cfe] Always create PatternSwitchStatement when patterns are enabled
...
This ensures that an otherwise regular switch statement has the new
switch statements semantics; using == calls and allowing user defined
== implementations.
Closes #50871
Change-Id: I0908b3a0adce959fe65ca61c5e94cf2a5e3f7e65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280109
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
2023-02-01 19:08:54 +00:00
Ahmed Ashour
7972c10f4e
[cfe] fix not found target for
...
`InlineClassBuilder`
Fixes #51069
Change-Id: I1827586f3fbf58adde469fa2123cf9497632d7b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280097
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-02-01 11:39:50 +00:00
Johnni Winther
25513e6f07
[cfe] Support constructor tear-off in inline classes
...
+ evaluate inline class annotations
Change-Id: Ia5a17b4ecf2fc273e347374c9ad7713301103c96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280101
Reviewed-by: Srujan Gaddam <srujzs@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-01-30 23:12:35 +00:00
Johnni Winther
4a63c9e76f
Reland "[cfe] Support external inline class fields"
...
This is a reland of commit 335d3afb78
Original change's description:
> [cfe] Support external inline class fields
>
> Change-Id: I0c16dc5c32aa8afb285b425c826eee8b8534c734
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278507
> Commit-Queue: Johnni Winther <johnniwinther@google.com >
> Reviewed-by: Jens Johansen <jensj@google.com >
Change-Id: Ic93a77d747248bd10b05a1f8119f2725355bd9f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279400
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-01-20 15:04:28 +00:00
Johnni Winther
21cc667dca
[Reland][cfe] Support external constructor with final fields
...
This adds support for having a final field and an external constructor
without error, assuming that the external constructor initializes the
final field. This supports the inline class with external members use
case.
Change-Id: I33b78275e967636ed0697d17f7921e9eee30401b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279095
Reviewed-by: Srujan Gaddam <srujzs@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2023-01-17 17:29:28 +00:00
Johnni Winther
deaf9ce16e
Revert "[cfe] Support external constructor with final fields"
...
This reverts commit c70d266270 .
Reason for revert: Crash detected
Original change's description:
> [cfe] Support external constructor with final fields
>
> This adds support for having a final field and an external constructor
> without error, assuming that the external constructor initializes the
> final field. This supports the inline class with external members use
> case.
>
> Change-Id: Ie297ccc39b0a0731c146f9ac0698bba3fd83bfeb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278502
> Reviewed-by: Srujan Gaddam <srujzs@google.com >
> Commit-Queue: Johnni Winther <johnniwinther@google.com >
> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I339d9008cb84cda8dc20f29d1e103289bb5596b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278820
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com >
Auto-Submit: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Srujan Gaddam <srujzs@google.com >
Commit-Queue: Srujan Gaddam <srujzs@google.com >
2023-01-10 17:20:01 +00:00
Johnni Winther
28a3c47c4c
Revert "[cfe] Support external inline class fields"
...
This reverts commit 335d3afb78 .
Reason for revert: Causes NPE in dart2js
Original change's description:
> [cfe] Support external inline class fields
>
> Change-Id: I0c16dc5c32aa8afb285b425c826eee8b8534c734
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278507
> Commit-Queue: Johnni Winther <johnniwinther@google.com >
> Reviewed-by: Jens Johansen <jensj@google.com >
TBR=jensj@google.com ,johnniwinther@google.com ,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I0826daf1ee9f1eb4c1489a239b795b13028e6a11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278700
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2023-01-09 18:59:37 +00:00
Johnni Winther
335d3afb78
[cfe] Support external inline class fields
...
Change-Id: I0c16dc5c32aa8afb285b425c826eee8b8534c734
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278507
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2023-01-09 09:53:11 +00:00
Johnni Winther
c70d266270
[cfe] Support external constructor with final fields
...
This adds support for having a final field and an external constructor
without error, assuming that the external constructor initializes the
final field. This supports the inline class with external members use
case.
Change-Id: Ie297ccc39b0a0731c146f9ac0698bba3fd83bfeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278502
Reviewed-by: Srujan Gaddam <srujzs@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
2023-01-06 12:25:21 +00:00
Johnni Winther
9aa28ddc3b
[cfe] Support inline generative constructor access
...
Change-Id: I4608f2fe8ab0a067814639c9dd160a690c3dad84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278180
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-01-05 08:53:38 +00:00
Johnni Winther
df9b753dc2
[cfe] Add support for inline class field access
...
The representation field of an inline class is not part of the
generated code - it does not have a corresponding synthesized top-level
methods like the other inline class members. Therefore, to support
access to the representation field, a new `representationName` field
is added to `InlineClass` that holds the name by which the
representation field can be accessed.
An access to the representation field is at runtime an access of the
receiver itself. To show that the static type of the expression changes
from the inline type of the receiver to the declared representation
type, an `AsExpression` is inserted. Since this check is not needed
at runtime, this node is marked with the new `isUnchecked` flag, that
backends can use to skip the check.
TEST=pkg/front_end/testcases/inline_class/field_access.dart
Change-Id: I635af414af2ddc541352078766ce57a9d8ded601
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277983
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-01-04 14:46:03 +00:00
Johnni Winther
8e07d492dd
[cfe] Support generic inline class constructors
...
Change-Id: Ibd12b14e1e8a1811734b4773c842e72a7fcb300c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277684
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
2022-12-29 23:17:39 +00:00
Johnni Winther
bf5fa95b4e
[cfe] Handle inline class method access in inference visitor
...
Change-Id: Ifc0b6ecafc6f9223147a0aec772d2af279cae176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277680
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-12-29 16:46:33 +00:00
Johnni Winther
40be3ef64e
[cfe] Support inline class constructor bodies
...
This disables the support for instance method access which needs to
be implemented differently. This will be done in a follow-up.
Change-Id: I2cd50cc4c7aba73859a7e1d81af975d87f10254a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277640
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-12-29 15:10:43 +00:00
Johnni Winther
d74965e319
[cfe] Check inline class constructor initializers
...
Change-Id: I6872ccd948f679e1e0b04b9f59bea833df11d5a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277141
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-12-28 16:34:14 +00:00
Johnni Winther
81845864ca
[kernel] Rename View* to Inline*
...
TEST=existing
Change-Id: I8726c936261ceb770b489f264d14fff02a1b4998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275243
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2022-12-14 08:36:57 +00:00
Johnni Winther
e742ecfa9e
[parser] Parse 'inline' instead of 'view'
...
Change-Id: I2ec0553fccf6caa3aa93275955c9e8e2213ee7f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275240
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-12-13 19:38:38 +00:00