Skip to content

Missing checks for final variables #33022

@askeksa-google

Description

@askeksa-google

It is illegal to write both final and var:

final var a = 0;

It is illegal for a final field to not have an initializer and not be initialized in every constructor (if there are no constructors, there is an implicit constructor which has no initializers):

class C {
  final a;
}

Both exposed by language_2/field3_test.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions