Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement named arguments anywhere feature #47451

Closed
22 of 23 tasks
chloestefantsova opened this issue Oct 13, 2021 · 27 comments
Closed
22 of 23 tasks

Implement named arguments anywhere feature #47451

chloestefantsova opened this issue Oct 13, 2021 · 27 comments
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). implementation Track the implementation of a specific feature (use on area-meta issue, not issues for each tool) P2 A bug or feature request we're likely to work on

Comments

@chloestefantsova
Copy link
Contributor

chloestefantsova commented Oct 13, 2021

This issue is for implementing dart-lang/language#1072 and referencing it in the related CLs.

The language flag here is named-arguments-anywhere, and the github project for this feature is https://github.com/orgs/dart-lang/projects/33.

Spec and test tasks

Implementation tasks

@chloestefantsova chloestefantsova added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. legacy-area-front-end Legacy: Use area-dart-model instead. labels Oct 13, 2021
@chloestefantsova chloestefantsova self-assigned this Oct 13, 2021
@chloestefantsova
Copy link
Contributor Author

The implementation in the CFE is landed as fcd684e.

@eernstg eernstg added the implementation Track the implementation of a specific feature (use on area-meta issue, not issues for each tool) label Oct 13, 2021
@mit-mit
Copy link
Member

mit-mit commented Oct 14, 2021

@chloestefantsova what experiment flag is this behind?

@chloestefantsova
Copy link
Contributor Author

@chloestefantsova what experiment flag is this behind?

At the moment, it's behind an internal CFE flag --enable-unscheduled-experiments. Once the actual experiment name is determined, it will be updated.

@eernstg
Copy link
Member

eernstg commented Oct 14, 2021

Perhaps --enable-experiment=named-arguments-anywhere?

@chloestefantsova
Copy link
Contributor Author

Perhaps --enable-experiment=named-arguments-anywhere?

I like the name :) I'll add the flag.

copybara-service bot pushed a commit that referenced this issue Oct 14, 2021
Since the check or the absence of the check for a named argument
appearing before a positional parameter is feature-specific
considering the language feature that allows placing the named
arguments anywhere, it should be performed by the listeners of the
parser and guarded by an experiment flag, in alignment with other
experimental featuers. This CL moves the check and the reporting of
the error from the parser into the Analyzer, so that later this check
can be skipped if the corresponding experiment flag is enabled.

Part of #47451.

Change-Id: Ib795d418af429ee04ecfff6dfa71ec1e836fe798
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216640
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
copybara-service bot pushed a commit that referenced this issue Oct 14, 2021
Part of #47451

Change-Id: I049519061d132eb681cc3aa67b1dea5d296e540e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216801
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
copybara-service bot pushed a commit that referenced this issue Oct 15, 2021
Part of #47451.

Change-Id: I7befc385261f2489b79f6c90f1bb903b02a413a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217001
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
copybara-service bot pushed a commit that referenced this issue Oct 19, 2021
Part of #47451.

Change-Id: I6e13e8642c287c2386f7a323ccd5e41d83c5b358
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217012
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
@srawlins srawlins added the P2 A bug or feature request we're likely to work on label Oct 22, 2021
@eernstg
Copy link
Member

eernstg commented Oct 25, 2021

@devoncarew, @srawlins, @chloestefantsova, I have the impression that this feature would be well placed in the language evolution pipeline at some point in Q1. Do you agree, and do you have a specific milestone in mind?

@srawlins
Copy link
Member

Q1 sounds great to me.

copybara-service bot pushed a commit that referenced this issue Oct 28, 2021
Part of #47451.

Change-Id: Ic3564833cf87d5ccfb8b43f589c241104ce6df61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217602
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
copybara-service bot pushed a commit that referenced this issue Oct 28, 2021
Part of #47451.

Change-Id: I0c865a6a37c6e31e57df037f65c298c449f297bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217013
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
@devoncarew
Copy link
Member

devoncarew commented Oct 29, 2021

I'm going to start creating sub-issues here to scope the work.

@devoncarew
Copy link
Member

@sigmundch - I assume the DDC and dart2js implementations are no-ops here. Can you confirm that (or ask someone else to)? Thanks!

@devoncarew
Copy link
Member

@a-siva / @mkustermann - can you confirm that the VM implementation for this is a no-op? Otherwise we'll create a tracking bug for the VM work.

@sigmundch
Copy link
Member

Agree, I believe nothing is needed for DDC and dart2js directly. /cc @nshahan @fishythefish

The only open question is whether there is work needed for the web debugger integration, which may entail some work in DDC. At a glance, I would be surprised if we needed anything special for that either, but it's good to double check. /cc @nshahan @annagrin

@mkustermann
Copy link
Member

mkustermann commented Nov 1, 2021

@a-siva / @mkustermann - can you confirm that the VM implementation for this is a no-op? Otherwise we'll create a tracking bug for the VM work.

It seems this is purely a use-site only feature, so one wouldn't need to worry about observing mixed positional and named parameters on declaration site with dart:mirrors.

If the CFE desugars use-sites to existing Kernel AST constructs with the correct evaluation order (@chloestefantsova guess this is true?), then there is indeed no work for the VM team here (pending @bkonyi's answer on vm-service, since that includes debugging support).

@devoncarew
Copy link
Member

@jakemac53 - do we expect any implementation work for this wrt build systems? If so we'll file an issue to track.

@jakemac53
Copy link
Contributor

jakemac53 commented Nov 1, 2021

Nothing major that jumps to mind other than general language versioning support which we already have in place.

Internally language versioning is weird (we don't expose actual versions to users), so some amount of work will have to happen to allow users to enable this (similar to how null safety is enabled internally).

EDIT: One other potential area of work would be around the analyzer apis - in general builders don't operate on method bodies though and shouldn't see these types of invocations, but some do go to the AST, and could be affected. Not anything the dart team owns though afaik.

@annagrin
Copy link
Contributor

annagrin commented Nov 3, 2021

The only open question is whether there is work needed for the web debugger integration, which may entail some work in DDC. At a glance, I would be surprised if we needed anything special for that either, but it's good to double check.

We would need to at least add tests for newly allowed expressions to evaluate correctly. The debugging support depends on whether there are any changes in the vm service API (@bkonyi) or significant changes to support the compilation in DDC (@nshahan) but most likely nothing needed to be done for the debugger.

@devoncarew
Copy link
Member

@bkonyi - can you speak to Anna's question above wrt any service protocol changes to support this feature?

@bkonyi
Copy link
Contributor

bkonyi commented Nov 30, 2021

Sorry for the delay. No, I don't think there's anything special we'd need to change from the service's perspective.

@devoncarew
Copy link
Member

Thanks!

@devoncarew
Copy link
Member

I'll keep a task for the vm service protocol to cover Anna's comment above - 'we would need to at least add tests for newly allowed expressions to evaluate correctly'. It sounds like no protocol / api changes however, so nothing that would leak through to other clients.

@nshahan - for Anna's other question - The debugging support depends ... or significant changes to support the compilation in DDC; I'm guessing that there would be no such?

@nshahan
Copy link
Contributor

nshahan commented Nov 30, 2021

@devoncarew My assumption was that there would be little to no implementation on the DDC side. I will take a look at the feature tests that are failing to get an idea of what will be required. I'll report back if I find any significant issues.

@nshahan
Copy link
Contributor

nshahan commented Dec 2, 2021

It looks like the failing tests in DDC are all related to redirecting constructors that apply named arguments anywhere in the redirection. We are not correctly creating the temporary variables created by the CFE lowering. I'll investigate a fix but it doesn't look like it will be very big.

See #47831

@devoncarew devoncarew removed area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. legacy-area-front-end Legacy: Use area-dart-model instead. labels Dec 3, 2021
@rakudrama
Copy link
Member

rakudrama commented Dec 11, 2021

Update: dart2js now passing.

dart2js has an existing bug (#47047) which is tickled by the new tests. I'll fix it (WIP https://dart-review.googlesource.com/c/sdk/+/223381)

@munificent
Copy link
Member

I have this implemented in dart_style now, but not yet released and rolled into the Dart SDK. I'll roll it in once I get enhanced enums done too.

@chloestefantsova
Copy link
Contributor Author

@devoncarew Can this issue be closed now, given the unchecked boxes in the top posting?

@devoncarew
Copy link
Member

Yes, I think we can close (and track any remaining work in separate issues).

@leafpetersen @mit-mit - I lost track of this issue when I switched away from TPM style work. Not sure what the new project management process for language features looks like going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). implementation Track the implementation of a specific feature (use on area-meta issue, not issues for each tool) P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests