Skip to content

Commit 2e53ead

Browse files
srawlinsCommit Queue
authored and
Commit Queue
committed
compiler: replace unsupported [this] comment references with this.
Work towards dart-lang/dartdoc#3761 Sibling CL to https://dart-review.googlesource.com/c/sdk/+/365204 The analyzer has never recognized `[this]` as a valid doc comment reference (and the `comment_references` lint rule has similarly reported such reference attempts). dartdoc has its own algorithms for resolving comment references, which we are dismantling in favor of a single resolution, provided by the analyzer. We've also decided against adding support in the analyzer (see https://github.com/dart-lang/linter/issues/2079), so these reference attempts should be re-written. Change-Id: I0a30a34c9f58bd6c98c6b83e607a973c9ba51ed7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366900 Commit-Queue: Samuel Rawlins <[email protected]> Auto-Submit: Samuel Rawlins <[email protected]> Reviewed-by: Mayank Patke <[email protected]>
1 parent fe91f3e commit 2e53ead

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

pkg/compiler/lib/src/closure.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class TypeVariableLocal implements Local {
341341
}
342342
}
343343

344-
/// A local variable used encode the direct (uncaptured) references to [this].
344+
/// A local variable used to encode the direct (uncaptured) references to `this`.
345345
class ThisLocal extends Local {
346346
final ClassEntity enclosingClass;
347347

pkg/compiler/lib/src/inferrer/type_graph_nodes.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,8 @@ abstract class CallSiteTypeInformation extends TypeInformation
10421042
@override
10431043
String toString() => 'Call site $debugName $type';
10441044

1045-
/// Add [this] to the graph being computed by [engine].
1045+
/// Add this [CallSiteTypeInformation] to the graph being computed by
1046+
/// [engine].
10461047
void addToGraph(InferrerEngine engine);
10471048

10481049
String get debugName => '$callNode';

pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,13 @@ abstract class TypeMask implements AbstractValue {
337337
return 'Unknown type mask $mask.';
338338
}
339339

340-
/// Returns a nullable variant of [this] type mask.
340+
/// Returns a nullable variant of this [TypeMask].
341341
TypeMask nullable() => withFlags(isNullable: true);
342342

343-
/// Returns a non-nullable variant of [this] type mask.
343+
/// Returns a non-nullable variant of this [TypeMask].
344344
TypeMask nonNullable() => withFlags(isNullable: false);
345345

346-
/// Returns a variant of [this] type mask whose value is neither `null` nor
346+
/// Returns a variant of this [TypeMask] whose value is neither `null` nor
347347
/// the late sentinel.
348348
TypeMask withoutFlags() =>
349349
withFlags(isNullable: false, hasLateSentinel: false);
@@ -359,14 +359,14 @@ abstract class TypeMask implements AbstractValue {
359359
/// Whether the only possible value in this mask is Null.
360360
bool get isNull;
361361

362-
/// Whether [this] is a sentinel for an uninitialized late variable.
362+
/// Whether this [TypeMask] is a sentinel for an uninitialized late variable.
363363
AbstractBool get isLateSentinel;
364364

365365
/// Whether a late sentinel is a valid value of this mask.
366366
bool get hasLateSentinel => isLateSentinel.isPotentiallyTrue;
367367

368-
/// Whether [this] mask is empty or only represents values tracked by flags
369-
/// (i.e. `null` and the late sentinel).
368+
/// Whether this [TypeMask] is empty or only represents values tracked by
369+
/// flags (i.e. `null` and the late sentinel).
370370
bool get isEmptyOrFlagged;
371371

372372
/// Whether this mask only includes instances of an exact class, and none of
@@ -411,13 +411,15 @@ abstract class TypeMask implements AbstractValue {
411411
/// otherwise returns `null`. This method is conservative.
412412
ClassEntity? singleClass(JClosedWorld closedWorld);
413413

414-
/// Returns a type mask representing the union of [this] and [other].
414+
/// Returns a type mask representing the union of this [TypeMask] and
415+
/// [other].
415416
TypeMask union(TypeMask other, CommonMasks domain);
416417

417418
/// Returns whether the intersection of this and [other] is empty.
418419
bool isDisjoint(TypeMask other, JClosedWorld closedWorld);
419420

420-
/// Returns a type mask representing the intersection of [this] and [other].
421+
/// Returns a type mask representing the intersection of this [TypeMask] and
422+
/// [other].
421423
TypeMask intersection(TypeMask other, CommonMasks domain);
422424

423425
/// Returns whether [element] is a potential target when being invoked on this

pkg/compiler/lib/src/ssa/optimize.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4254,7 +4254,8 @@ class MemorySet {
42544254
}
42554255
}
42564256

4257-
/// Returns the intersection between [this] and the [other] memory set.
4257+
/// Returns the intersection between this [MemorySet] and the [other] memory
4258+
/// set.
42584259
MemorySet intersectionFor(
42594260
MemorySet? other, HBasicBlock block, int predecessorIndex) {
42604261
MemorySet result = MemorySet(closedWorld);
@@ -4335,7 +4336,7 @@ class MemorySet {
43354336
return result;
43364337
}
43374338

4338-
/// Returns a copy of [this] memory set.
4339+
/// Returns a copy of this [MemorySet].
43394340
MemorySet clone() {
43404341
MemorySet result = MemorySet(closedWorld);
43414342

@@ -4351,7 +4352,7 @@ class MemorySet {
43514352
return result;
43524353
}
43534354

4354-
/// Returns a copy of [this] memory set, removing any expressions that are not
4355+
/// Returns a copy of this [MemorySet], removing any expressions that are not
43554356
/// valid in [block].
43564357
MemorySet cloneIfDominatesBlock(HBasicBlock block) {
43574358
bool instructionDominatesBlock(HInstruction? instruction) {

pkg/compiler/lib/src/universe/selector.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ class Selector {
239239
return signatureApplies(element as FunctionEntity);
240240
}
241241

242-
/// Whether [this] could be a valid selector on `Null` without throwing.
242+
/// Whether this [Selector] could be a valid selector on `Null` without
243+
/// throwing.
243244
bool appliesToNullWithoutThrow() {
244245
var name = this.name;
245246
if (isOperator && name == "==") return true;

0 commit comments

Comments
 (0)