Open
Description
Example:
abstract class C {
abstract int x;
const C(); // Error here.
}
abstract class D {
int get x;
set x(int _);
const D();
}
void main() {}
is rejected with the message:
error
line 3 • Can't define a const constructor for a class with non-final fields. (view docs)
Try making all of the fields final, or removing the keyword 'const' from the constructor.
This is incorrect, since the class C
does not have any non-final instance variables, or instance variables at all.
It has an abstract
variable declaration, but that introduces an abstract getter and setter, which are not backed by an instance variable.