Skip to content

Commit 11e922f

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Update a few documentation comments for elements to remove null.
#45236 (comment) Change-Id: Ic9aa0b120cb0796ad1796c6f34aef8fc5360700a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191481 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 8bc9d55 commit 11e922f

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

pkg/analyzer/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 1.3.0-dev
22
* Added `Expression.inConstantContext` to API.
3+
* Updated documentation comments for some getters that don't return `null`.
34

45
## 1.2.0
56
* Deprecated all setters in API of AST. Use `parseString()` instead.

pkg/analyzer/lib/dart/element/element.dart

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,8 @@ abstract class Element implements AnalysisTarget {
531531
/// element, e.g. a synthetic property accessor), return itself.
532532
Element? get declaration;
533533

534-
/// Return the display name of this element, or `null` if this element does
535-
/// not have a name.
534+
/// Return the display name of this element, possibly the empty string if
535+
/// this element does not have a name.
536536
///
537537
/// In most cases the name and the display name are the same. Differences
538538
/// though are cases such as setters where the name of some setter `set f(x)`
@@ -1041,9 +1041,7 @@ abstract class ExecutableElement implements FunctionTypedElement {
10411041
Element get enclosingElement;
10421042

10431043
/// Return `true` if this executable element did not have an explicit return
1044-
/// type specified for it in the original source. Note that if there was no
1045-
/// explicit return type, and if the element model is fully populated, then
1046-
/// the [returnType] will not be `null`.
1044+
/// type specified for it in the original source.
10471045
bool get hasImplicitReturnType;
10481046

10491047
/// Return `true` if this executable element is abstract. Executable elements
@@ -1231,9 +1229,7 @@ abstract class FunctionTypedElement implements TypeParameterizedElement {
12311229
/// element.
12321230
List<ParameterElement> get parameters;
12331231

1234-
/// Return the return type defined by this element. If the element model is
1235-
/// fully populated, then the [returnType] will not be `null`, even if no
1236-
/// return type was explicitly specified.
1232+
/// Return the return type defined by this element.
12371233
DartType get returnType;
12381234

12391235
/// Return the type defined by this element.
@@ -1874,9 +1870,7 @@ abstract class VariableElement implements Element, ConstantEvaluationTarget {
18741870
/// > implicitly static.
18751871
bool get isStatic;
18761872

1877-
/// Return the declared type of this variable, or `null` if the variable did
1878-
/// not have a declared type (such as if it was declared using the keyword
1879-
/// 'var').
1873+
/// Return the declared type of this variable.
18801874
DartType get type;
18811875

18821876
/// Return a representation of the value of this variable, forcing the value

0 commit comments

Comments
 (0)