Enforce Required, Named Parameters #42438
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
As a developer, when I define a class with a required, named parameter I would like all subclasses to have errors (or at least a warning) if the required parameter was not passed to the superclass.
The above snippet currently won't compile (expected):
![Screen Shot 2020-06-22 at 12 35 08 PM](https://user-images.githubusercontent.com/8855632/85312451-d88ca480-b484-11ea-8b14-9642ada2bf68.png)
If I refactor class A to make
x
a required, named parameter, however, the code compiles just fine without any error/warning (not expected).This will definitely not be an issue once NNBD lands in stable but for now it's seems there isn't a good way to safely support required, named parameters.
Additional Info
This tracker is for issues related to:
Dart Version
Dart VM version: 2.8.4 (stable) (Wed Jun 3 12:26:04 2020 +0200) on "macos_x64"
OS
MacOSX
The text was updated successfully, but these errors were encountered: