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
voidmain() {
var _fn = (String name) => name.toUpperCase();
// ^ Unnecessary type annotation on a function expression parameter. Try removing the type annotation._fn('a');
And if I remove the type hint:
voidmain() {
var _fn = (name) => name.toUpperCase();
// ^ The type of name can't be inferred; a type must be explicitly provided.
Further investigation shows that it's because of using the lint avoid_types_on_closure_parameters and strict-inference in conjunction. Both VSCodium and VSCode shows the same warning with following analysis options:
srawlins
changed the title
False positive: Unnecessary type annotation on a function expression
False positive: avoid_types_on_closure_parameters on closure assigned to a variable.
Aug 1, 2023
And if I remove the type hint:
Actual example:
The text was updated successfully, but these errors were encountered: