Coding style. Add the reason for using 'var' and not 'final'. Change-Id: Id30cad3b8c5e45d290d6f1cf5bdc79320e6ff0b7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362900 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analyzer/doc/implementation/coding_style.md b/pkg/analyzer/doc/implementation/coding_style.md index 0fb919ed..ca39afa 100644 --- a/pkg/analyzer/doc/implementation/coding_style.md +++ b/pkg/analyzer/doc/implementation/coding_style.md
@@ -91,6 +91,10 @@ - We use `final` if the local variable shadows a field and is being used to allow the type of the field to be promoted. +The reason to prefer `var` over `final` is that the majority of the team felt +that the benefit of using `var` was slightly greater than the benefit of +using `final`. + ## Styles we're discussing This section documents the styles we are currently discussing. The purpose