Skip to content

Commit 02440ed

Browse files
srawlinsCommit Queue
authored andcommitted
Analyzer: Fix a few dozen comment references
Change-Id: I4a028f156aeaf8db532423c627aa9644f77b518c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402900 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 46987d9 commit 02440ed

File tree

20 files changed

+66
-65
lines changed

20 files changed

+66
-65
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ abstract class JoinPatternVariableFragment implements PatternVariableFragment {
14241424
@override
14251425
JoinPatternVariableElement2 get element;
14261426

1427-
/// Whether the [variables] are consistent.
1427+
/// Whether the [variables2] are consistent.
14281428
///
14291429
/// The variables are consistent if they are present in all branches, and have
14301430
/// the same type and finality.
@@ -1796,7 +1796,7 @@ abstract class LocalFunctionElement
17961796
LocalFunctionFragment get firstFragment;
17971797
}
17981798

1799-
/// The portion of a [LocalFunctionElement2] contributed by a single
1799+
/// The portion of a [LocalFunctionElement] contributed by a single
18001800
/// declaration.
18011801
///
18021802
/// Clients may not extend, implement or mix-in this class.

pkg/analyzer/lib/src/dart/analysis/session_helper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class AnalysisSessionHelper {
8484
return null;
8585
}
8686

87-
/// Return the resolved unit that declares the given [element].
87+
/// Return the resolved unit that declares the given [element2].
8888
Future<ResolvedUnitResult?> getResolvedUnitByElement(
8989
Element2 element2) async {
9090
var element = element2.asElement;

pkg/analyzer/lib/src/dart/constant/evaluation.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,9 +1351,9 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
13511351
/// Builds a list constant by adding the evaluated entries of [elements] to
13521352
/// the given [list].
13531353
///
1354-
/// The [typeSystem], [listType], and [elementType] are used to create a valid
1355-
/// constant. We return an [InvalidConstant] if the evaluation of any of the
1356-
/// elements failed.
1354+
/// The [typeSystem] and [listType] are used to create a valid constant. We
1355+
/// return an [InvalidConstant] if the evaluation of any of the elements
1356+
/// failed.
13571357
Constant _buildListConstant(
13581358
List<DartObjectImpl> list,
13591359
List<CollectionElement> elements,

pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ class ExtensionMemberResolver {
8181
/// that defines the member with the given [name].
8282
///
8383
/// If no applicable extensions are found, returns
84-
/// [ExtensionResolutionResult.none].
84+
/// [ExtensionResolutionError.none].
8585
///
8686
/// If the match is ambiguous, reports an error on the [nameEntity], and
87-
/// returns [ExtensionResolutionResult.ambiguous].
87+
/// returns [ExtensionResolutionError.ambiguous].
8888
ExtensionResolutionResult findExtension(
8989
DartType type, SyntacticEntity nameEntity, Name name) {
9090
var extensions = _resolver.libraryFragment.accessibleExtensions

pkg/analyzer/lib/src/generated/error_detection_helpers.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
/// @docImport 'package:analyzer/src/error/best_practices_verifier.dart';
6+
library;
7+
58
import 'package:_fe_analyzer_shared/src/flow_analysis/flow_analysis.dart';
69
import 'package:_fe_analyzer_shared/src/types/shared_type.dart';
710
import 'package:analyzer/dart/ast/ast.dart';
@@ -55,9 +58,6 @@ mixin ErrorDetectionHelpers {
5558
/// Verify that the given [argument] can be assigned to its corresponding
5659
/// parameter.
5760
///
58-
/// This method corresponds to
59-
/// [BestPracticesVerifier.checkForArgumentTypeNotAssignableForArgument].
60-
///
6161
/// See [CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
6262
void checkForArgumentTypeNotAssignableForArgument(Expression argument,
6363
{bool promoteParameterToNullable = false,
@@ -291,9 +291,9 @@ mixin ErrorDetectionHelpers {
291291
}
292292

293293
/// Computes the appropriate set of context messages to report along with an
294-
/// error that may have occurred because [expression] was not type promoted.
294+
/// error that may have occurred because an expression was not type promoted.
295295
///
296-
/// If [expression] is `null`, it means the expression that was not type
296+
/// If the expression is `null`, it means the expression that was not type
297297
/// promoted was an implicit `this`.
298298
///
299299
/// [errorEntity] is the entity whose location will be associated with the

pkg/analyzer/lib/src/generated/error_verifier.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,7 +2668,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
26682668
/// Verify all conflicts between type variable and enclosing extension.
26692669
///
26702670
/// See [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION], and
2671-
/// [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION_MEMBER].
2671+
/// [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION].
26722672
void _checkForConflictingExtensionTypeVariableErrorCodes() {
26732673
for (TypeParameterElement typeParameter
26742674
in _enclosingExtension!.typeParameters) {
@@ -3346,7 +3346,8 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
33463346
);
33473347
}
33483348

3349-
/// Verify that the given extends [clause] does not extend a deferred class.
3349+
/// Verifies that the given [superclass], found in an extends-clause, is not a
3350+
/// deferred class.
33503351
///
33513352
/// See [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS].
33523353
void _checkForExtendsDeferredClass(NamedType? superclass) {
@@ -3357,8 +3358,8 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
33573358
superclass, CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS);
33583359
}
33593360

3360-
/// Verify that the given extends [clause] does not extend classes such as
3361-
/// 'num' or 'String'.
3361+
/// Verifies that the given [superclass], found in an extends-clause, is not a
3362+
/// class such as 'num' or 'String'.
33623363
///
33633364
/// See [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS].
33643365
bool _checkForExtendsDisallowedClass(NamedType? superclass) {
@@ -3373,8 +3374,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
33733374
/// classes that are deferred.
33743375
///
33753376
/// See [_checkForExtendsDeferredClass],
3376-
/// [_checkForExtendsDeferredClassInTypeAlias],
3377-
/// [_checkForImplementsDeferredClass],
33783377
/// [_checkForAllMixinErrorCodes],
33793378
/// [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS],
33803379
/// [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS], and
@@ -3663,7 +3662,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
36633662

36643663
/// If there are no constructors in the given [members], verify that all
36653664
/// final fields are initialized. Cases in which there is at least one
3666-
/// constructor are handled in [_checkForAllFinalInitializedErrorCodes].
3665+
/// constructor are handled in [_checkForFinalNotInitialized].
36673666
///
36683667
/// See [CompileTimeErrorCode.CONST_NOT_INITIALIZED], and
36693668
/// [CompileTimeErrorCode.FINAL_NOT_INITIALIZED].
@@ -5394,7 +5393,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
53945393
}
53955394

53965395
/// Verify that the given [element] does not reference itself directly.
5397-
/// If it does, report the error on the [node].
5396+
/// If it does, report the error on the [nameToken].
53985397
///
53995398
/// See [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF].
54005399
void _checkForTypeAliasCannotReferenceItself(

pkg/analyzer/lib/src/generated/ffi_verifier.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ class FfiVerifier extends RecursiveAstVisitor<void> {
11841184
}
11851185

11861186
/// Validate that the [annotations] include exactly one annotation that
1187-
/// satisfies the [requiredTypes]. If an error is produced that cannot be
1187+
/// satisfies the [requiredType]. If an error is produced that cannot be
11881188
/// associated with an annotation, associate it with the [errorNode].
11891189
void _validateAnnotations(TypeAnnotation errorNode,
11901190
NodeList<Annotation> annotations, _PrimitiveDartType requiredType) {

pkg/analyzer/lib/src/generated/resolver.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4424,9 +4424,9 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
44244424
return true;
44254425
}
44264426

4427-
/// Report [CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS] or one of
4428-
/// its derivatives at the specified [token], considering the name of the
4429-
/// [nameNode].
4427+
/// Reports [CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR] or
4428+
/// [CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL] at the
4429+
/// specified [token], considering the name of the [nameNode].
44304430
static void _reportNotEnoughPositionalArguments(
44314431
{required Token token,
44324432
required int requiredParameterCount,

pkg/analyzer/lib/src/generated/sdk.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class LibraryMap {
131131
/// not map to a library.
132132
SdkLibrary? getLibrary(String uri) => _libraryMap[uri];
133133

134-
/// Set the library with the given 'dart:' [uri] to the given [library].
134+
/// Set the library with the given 'dart:' [dartUri] to the given [library].
135135
void setLibrary(String dartUri, SdkLibraryImpl library) {
136136
_libraryMap[dartUri] = library;
137137
}
@@ -193,7 +193,7 @@ class SdkLibrariesReader_LibraryBuilder extends RecursiveAstVisitor<void> {
193193
/// the library can be used.
194194
static const String _PLATFORMS = "platforms";
195195

196-
/// The value of the [PLATFORMS] parameter used to specify that the library
196+
/// The value of the [_PLATFORMS] parameter used to specify that the library
197197
/// can be used on the VM.
198198
static const String _VM_PLATFORM = "VM_PLATFORM";
199199

@@ -333,7 +333,7 @@ class SdkLibraryImpl implements SdkLibrary {
333333
int _platforms = 0;
334334

335335
/// Initialize a newly created library to represent the library with the given
336-
/// [name].
336+
/// [shortName].
337337
SdkLibraryImpl(this.shortName);
338338

339339
/// Set whether the library is documented.

pkg/analyzer/lib/src/generated/source.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ abstract class SourceFactory {
122122
/// there is no such SDK
123123
DartSdk? get dartSdk;
124124

125-
/// A table mapping package names to paths of directories containing
126-
/// the package (or [null] if there is no registered package URI resolver).
125+
/// A table mapping package names to paths of directories containing the
126+
/// package (or `null` if there is no registered package URI resolver).
127127
Map<String, List<Folder>>? get packageMap;
128128

129129
/// Return a source object representing the given absolute URI, or `null` if

0 commit comments

Comments
 (0)