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

Migration engine does not support extensions #39387

Closed
stereotype441 opened this issue Nov 14, 2019 · 2 comments
Closed

Migration engine does not support extensions #39387

stereotype441 opened this issue Nov 14, 2019 · 2 comments
Labels
area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). NNBD Issues related to NNBD Release P3 A lower priority bug or feature request

Comments

@stereotype441
Copy link
Member

The migration engine needs to support extensions. This entails several things:

  • Support for extension declaration syntax
  • Creating the proper graph edges to determine whether the type mentioned in an extension declaration's "on" clause should be made nullable
  • Understanding that inside an extension declaration, if the type mentioned in an extension declaration's "on" clause is nullable, then this should be considered nullable
  • Understanding that if the type mentioned in an extension declarations's "on" clause is nullable, then a use of the extension does not need to be null checked
  • Support for explicit extension instantiation syntax
@stereotype441 stereotype441 added analyzer-nnbd-migration NNBD Issues related to NNBD Release labels Nov 14, 2019
@keertip keertip added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Nov 15, 2019
@srawlins
Copy link
Member

srawlins commented May 26, 2020

Some support has been added, but there is now at least one crash:

class C<T> {}
void f(C<List> x) {}
extension E on C<List> {
  g() => f(this);
}

(In edge_builder's _thisOrSuper, DecoratedType() is called for type arguments which themselves have type arguments.) This is manifested in migrating petitparser.

Additionally the case of extending Function is not handled:

extension CurryFunction<R, S, T> on R Function(S, T) {
  /// Curry a binary function with its first argument.
  R Function(T) curry(S first) => (T second) => this(first, second);
}

I am checking in two failing tests.

dart-bot pushed a commit that referenced this issue May 26, 2020
Bug: #39387
Change-Id: I2187db2433255fd950789942712d215c2472db4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149005
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
@srawlins srawlins added the P2 A bug or feature request we're likely to work on label Sep 8, 2020
@srawlins srawlins added P3 A lower priority bug or feature request and removed P2 A bug or feature request we're likely to work on labels Oct 5, 2020
dart-bot pushed a commit that referenced this issue Nov 16, 2020
Bug: #39387
Change-Id: I037d29355dc86c071acc8dcc6f417a95e96e9728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172200
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
@stereotype441 stereotype441 added area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). and removed analyzer-nnbd-migration area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 16, 2020
dart-bot pushed a commit that referenced this issue Nov 16, 2020
This functionality is working now, the test was just broken.

Bug: #39387
Change-Id: I088a3bd40ac438d0a9cd2356badfaf9513aa4bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172280
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
@stereotype441
Copy link
Member Author

As of 1c7fe71, the null safety migration tool has been removed from active development and retired. No further work on the tool is planned.

If you still need help, or you believe this issue has been closed in error, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). NNBD Issues related to NNBD Release P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

3 participants