We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e11f8f commit 1c12bbbCopy full SHA for 1c12bbb
lint_test/dont_create_a_return_var_test.dart
@@ -31,6 +31,19 @@ int returnVarTestCachedMutable() {
31
return result;
32
}
33
34
+/// Test the dont_create_a_return_var.
35
+/// Caching mutable variable value, but return goes
36
+/// right after declaration, which makes it bad.
37
+int returnVarTestReturnFollowsDeclaration() {
38
+ var a = 1;
39
+ final result = a;
40
+
41
+ //Some comment here
42
43
+ //expect_lint: dont_create_a_return_var
44
+ return result;
45
+}
46
47
/// Test the dont_create_a_return_var.
48
/// Caching another method result.
49
/// Unpredictable: may be useful to cache value
0 commit comments