You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following info will be issued: info: A value for optional parameter 'key' isn't ever given. (unused_element at [...] lib/...)
To Reproduce
Use the code above with Dart 2.17+ and unused_elements enabled.
Expected behavior
The linter should behave equally for both codes, as they are virtually the same. When using super parameters, however, the linter will incorrectly fire an info.
Additional context:
This issue, obviously, won't happen if the class is public.
Possible workaround:
A possible workaround is to provide a value, like ({super.key = null}). However, it does conflict with avoid_init_to_null.
The text was updated successfully, but these errors were encountered:
mateusfccp
changed the title
unused_elements false-positive when using super parameters on private classesunused_element false-positive when using super parameters on private classes
May 30, 2022
Describe the issue
Consider the following code:
This code won't trigger any info/warning.
However, if I use super parameters instead:
The following info will be issued:
info: A value for optional parameter 'key' isn't ever given. (unused_element at [...] lib/...)
To Reproduce
Use the code above with Dart 2.17+ and
unused_elements
enabled.Expected behavior
The linter should behave equally for both codes, as they are virtually the same. When using super parameters, however, the linter will incorrectly fire an info.
Additional context:
This issue, obviously, won't happen if the class is public.
Possible workaround:
A possible workaround is to provide a value, like
({super.key = null})
. However, it does conflict withavoid_init_to_null
.The text was updated successfully, but these errors were encountered: