Skip to content

Commit 10759dd

Browse files
srawlinsCommit Queue
authored andcommitted
Update comments about context types and inference
A follow-up from Konstantin's comments here: https://dart-review.googlesource.com/c/sdk/+/392501 Change-Id: I19853831d304c2ea3267969e99249ff356aad3ad Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392600 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 81f4b71 commit 10759dd

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

pkg/analyzer/lib/src/dart/ast/ast.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15675,15 +15675,6 @@ final class SetOrMapLiteralImpl extends TypedLiteralImpl
1567515675
_SetOrMapKind _resolvedKind = _SetOrMapKind.unresolved;
1567615676

1567715677
/// The context type computed by [TypedLiteralResolver].
15678-
///
15679-
/// Note that this isn't the same as the context pushed down by type
15680-
/// inference (which can be obtained via `InferenceContext.getContext`). For
15681-
/// example, in the following code:
15682-
///
15683-
/// var m = {};
15684-
///
15685-
/// The context pushed down by type inference is null, whereas the
15686-
/// `contextType` is `Map<dynamic, dynamic>`.
1568715678
InterfaceType? contextType;
1568815679

1568915680
/// Initializes a newly created set or map literal.

pkg/analyzer/lib/src/dart/element/generic_inferrer.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ import 'package:collection/collection.dart';
4747
/// (due to covariant generic types) as would `() -> A <: () -> num`. In
4848
/// contrast `(A) -> void <: (num) -> void`.
4949
///
50-
/// Once the lower/upper bounds are determined, `infer` should be called to
51-
/// finish the inference. It will instantiate a generic function type with the
52-
/// inferred types for each type parameter.
50+
/// Once the lower/upper bounds are determined, `chooseFinalTypes` should be
51+
/// called to finish the inference. It will instantiate a generic function type
52+
/// with the inferred types for each type parameter.
5353
///
5454
/// It can also optionally compute a partial solution, in case some of the type
5555
/// parameters could not be inferred (because the constraints cannot be

0 commit comments

Comments
 (0)