Skip to content

Commit 829b9f4

Browse files
stereotype441Commit Queue
authored andcommitted
Fix comment references in shared exhaustiveness logic.
Fix bracketed references in doc comments that previously pointed to nowhere, in the shared exhaustiveness logic (pkg/_fe_analyzer_shared/lib/src/exhaustiveness/...). This is part of a larger effort to clean up _fe_analyzer_shared to the point where the `comment_references` lint can be enabled. Change-Id: I743cf6537316ba14ffbb90e9d93fb67c451bb308 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375220 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 791163e commit 829b9f4

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class _Checker {
278278
/// [singleSpace] doesn't care about that property, so inserts a default
279279
/// [Space] that matches all values for the property. If the [type] doesn't
280280
/// know about the property, the static type of the property is read from
281-
/// [extensionPropertyTypes].
281+
/// [Key].
282282
///
283283
/// In other words, this unpacks a set of properties so that the main
284284
/// algorithm can add them to the worklist.

pkg/_fe_analyzer_shared/lib/src/exhaustiveness/path.dart

Lines changed: 3 additions & 0 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 'space.dart';
6+
library;
7+
58
import 'key.dart';
69

710
/// A path that describes location of a [SingleSpace] from the root of

pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class ExhaustivenessCache<
139139
/// Cache for [SealedClassInfo] for sealed classes.
140140
Map<Class, SealedClassInfo<Type, Class>> _sealedClassInfo = {};
141141

142-
/// Cache for [UniqueStaticType]s.
142+
/// Cache for unique [StaticType]s.
143143
Map<Object, StaticType> _uniqueTypeMap = {};
144144

145145
/// Cache for the [StaticType] for `bool`.
@@ -458,8 +458,8 @@ mixin SpaceCreator<Pattern extends Object, Type extends Object> {
458458
return new Space(path, staticType, properties: properties);
459459
}
460460

461-
/// Creates the [Space] at [path] for a record pattern of the required [type],
462-
/// [positionalFields], and [namedFields].
461+
/// Creates the [Space] at [path] for a record pattern of the required
462+
/// [recordType], [positionalFields], and [namedFields].
463463
Space createRecordSpace(Path path, StaticType contextType, Type recordType,
464464
List<Pattern> positionalFields, Map<String, Pattern> namedFields) {
465465
StaticType staticType =

pkg/_fe_analyzer_shared/lib/src/exhaustiveness/test_helper.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ String spacesToText(Space space) {
3030
return text;
3131
}
3232

33-
/// Returns a textual representation for [properties] used for testing.
33+
/// Returns a textual representation for [fieldsOfInterest] used for testing.
3434
String fieldsToText(StaticType type, ObjectPropertyLookup objectFieldLookup,
3535
Set<Key> fieldsOfInterest) {
3636
List<Key> sortedNames = fieldsOfInterest.toList()..sort();
@@ -64,7 +64,7 @@ String fieldsToText(StaticType type, ObjectPropertyLookup objectFieldLookup,
6464
/// Returns a textual representation for [type] used for testing.
6565
String staticTypeToText(StaticType type) => type.toString();
6666

67-
/// Returns a textual representation of the subtypes of [type] used for testing.
67+
/// Returns a textual representation of [types] used for testing.
6868
String? typesToText(Iterable<StaticType> types) {
6969
if (types.isEmpty) return null;
7070
// TODO(johnniwinther): Sort types.

pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/enum.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class EnumInfo<Type extends Object, EnumClass extends Object,
7373
}
7474

7575
/// [StaticType] for an instantiation of an enum that support access to the
76-
/// enum values that populate its type through the [subtypes] property.
76+
/// enum values that populate its type through the [getSubtypes] getter.
7777
class EnumStaticType<Type extends Object, EnumElement extends Object>
7878
extends TypeBasedStaticType<Type> {
7979
final EnumInfo<Type, Object, EnumElement, Object> _enumInfo;

pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Witness {
8181
String toString() => _witness.toString();
8282
}
8383

84-
/// Helper class used to turn a list of [Predicates] into a string.
84+
/// Helper class used to turn a list of [Predicate]s into a string.
8585
class PropertyWitness {
8686
StaticType staticType = StaticType.nullableObject;
8787
StaticType valueType = StaticType.nullableObject;

0 commit comments

Comments
 (0)