Skip to main content

No object declaration

Rule id

no-object-declaration

Severity

Style

Description

Warns when a class member is declared with Object type.

Example

Bad:

class Test {
Object data = 1; // LINT

Object get getter => 1; // LINT

// LINT
Object doWork() {
return;
}
}

Good:

class Test {
int data = 1;

int get getter => 1;

void doWork() {
return;
}
}