Skip to content

Code completion shows getter type as nullable for type that overrides to non-nullable #4499

@incendial

Description

@incendial

Describe the bug
When a class has an implementation that overrides a getter (and also marks the type as non-nullable), the getter type is still shown as nullable in the autocomplete suggestion.

Screenshot 2023-04-19 at 13 00 28

Screenshot 2023-04-19 at 13 00 41

https://github.com/dart-lang/sdk/blob/fb43937e201b76a3a53cb5bb6a001b4c79463939/pkg/analyzer/lib/dart/element/element.dart#L1706

To Reproduce
Start typing name prop of InterfaceOrAugmentationElement.

Please complete the following information:

  • Operating System and version: macOS
  • VS Code version: 1.77.3
  • Dart extension version: v3.63.20230405
  • Dart/Flutter SDK version: 2.19.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions