Recursive getter does not throw warning when using pattern matching #4913
Labels
false-negative
P3
A lower priority bug or feature request
set-recommended
Affects a rule in the recommended Dart rule set
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
So, if you declare a class with a getter, like this:
The
recursive_getters
rule should warn this case, shouldn't it? Pattern matching does allow you to refer to the getter you're declaring (on its declaration scope body). The same occurs when you create a getter through an extension.I fell in this case because of my copilot, when I tried to build it by running the tests, it just crashed with a non-descriptive error, probably because it is like a recursion with no break. It should not be allowed since it always falls in a runtime error.
Obs.: Re-opening it from dart-lang/language#3652.
The text was updated successfully, but these errors were encountered: