Skip to content

Unexpected compile time errors for finals with definite assignment #43285

@nshahan

Description

@nshahan

Failing tests:

co19/Language/Variables/final_t04
co19/Language/Variables/final_t05
co19/Language/Variables/final_t06
co19/Language/Variables/final_t07

These tests produce unexpected compile time errors of the form:

org-dartlang-app:/tests/co19/src/Language/Variables/final_t04.dart:27:9: Error: The final variable 'i' must be initialized.
Try adding an initializer ('= expression') to the declaration.
  final i;
        ^
org-dartlang-app:/tests/co19/src/Language/Variables/final_t04.dart:28:3: Error: Can't assign to the final variable 'i'.
  i = 1;
  ^

@johnniwinther

Metadata

Metadata

Assignees

No one assigned

    Labels

    NNBDIssues related to NNBD Releaselegacy-area-front-endLegacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions