Skip to content

Files

Latest commit

 

History

History
28 lines (20 loc) · 503 Bytes

recursive_getters.md

File metadata and controls

28 lines (20 loc) · 503 Bytes

Pattern: Use of recursive getter

Issue: -

Description

Recursive getters are getters which return themselves as a value. This is usually a typo.

Example of incorrect code:

int get field => field; // LINT

Example of incorrect code:

int get otherField {
 return otherField; // LINT
}

Example of correct code:

int get field => _field;

Further Reading