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

Restore FieldFormalParameterElement.hasImplicitType #46039

Closed
scheglov opened this issue May 17, 2021 · 2 comments
Closed

Restore FieldFormalParameterElement.hasImplicitType #46039

scheglov opened this issue May 17, 2021 · 2 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on

Comments

@scheglov
Copy link
Contributor

scheglov commented May 17, 2021

We have an internal issue with code like

class TestObject {
  final int num;

  const TestObject(this.num);
}

In https://dart-review.googlesource.com/c/sdk/+/200060 we started to set hasImplicitType for this.num to true. Which is correct, I think, because it does not have an explicit type specified, and it does not have its own formal parameters (so is not function typed). Then the linter will check if the name num is resolved into a class. Well, yes, it is. But we don't resolve num here, we resolve this.num.

For now I will revert to the previous behavior, but we need to fix the linter, and restore the correct hasImplicitType value.

@scheglov scheglov added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on labels May 17, 2021
@scheglov scheglov self-assigned this May 17, 2021
@scheglov
Copy link
Contributor Author

Disable hasImplicitType for field formal parameters for now.
https://dart-review.googlesource.com/c/sdk/+/200280

dart-bot pushed a commit that referenced this issue May 17, 2021
Bug: #46039
Bug: https://buganizer.corp.google.com/issues/188405800
Change-Id: Iefbe86ffd49c00aa25143f7495a981d4e15f3dae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov
Copy link
Contributor Author

scheglov commented Jun 3, 2021

dart-bot pushed a commit that referenced this issue Jun 3, 2021
This reverts commit 33231b3.

The necessary fix landed into linter, and pulled into SDK and google3.
dart-lang/linter#2674

Bug: #46039
Change-Id: I24a6fea41aa749c5fc7ffffc842d119d2a617658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202262
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov scheglov closed this as completed Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

1 participant