-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Analyzer treats required named parameters in superclasses as non-optional from legacy libraries #43397
Comments
And a reference to required parameters being optional in the definition of |
@munificent we evidently don't have a test for this, any chance you could add one? |
How did I know you were going to say that? :) @scheglov, would you like me to write a test for this or will you in the process of fixing it? I won't get to it until Monday, but I'm happy to then. |
This should fix the issue in the analyzer. |
Bug: #43397 Change-Id: I1cd4ae4bea441732d1c6ef68a917fcccb144ec62 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162584 Reviewed-by: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I756d4f4a768ff08e81fd2b90a6c76d833cc8ba0b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163740 Auto-Submit: Bob Nystrom <rnystrom@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Language test: https://dart-review.googlesource.com/c/sdk/+/163740 |
Given this legacy library:
// And this null-safe one:
I would expect this code to be OK. The implicit
super()
call in Legacy to callNullSafe()
should be allowed because NullSafe's required named parameter should be treated as optional from the context of a legacy library.Instead, I get:
The text was updated successfully, but these errors were encountered: