Rename InterfaceResolver.strongMode to legacyMode
Change-Id: I4d77f735d2442d278f6edbc8559ee408d8f207e8
Reviewed-on: https://dart-review.googlesource.com/c/84405
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index ea542e0..9c6178f 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -927,7 +927,7 @@
typeInferenceEngine,
typeInferenceEngine.typeSchemaEnvironment,
instrumentation,
- !target.legacyMode);
+ target.legacyMode);
builders.forEach((Uri uri, LibraryBuilder library) {
if (library.loader == this) {
library.forEach((String name, Declaration member) {
diff --git a/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart b/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart
index 3c56a5e..fba244b 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart
@@ -257,7 +257,7 @@
/// they would not be checked in an inherited implementation, a forwarding
/// stub is introduced as a place to put the checks.
Procedure _computeCovarianceFixes(Procedure interfaceMember) {
- assert(_interfaceResolver.strongMode);
+ assert(!_interfaceResolver.legacyMode);
var substitution =
_interfaceResolver._substitutionFor(interfaceMember, enclosingClass);
// We always create a forwarding stub when we've inherited a member from an
@@ -546,7 +546,7 @@
/// Creates a forwarding stub for this node if necessary, and propagates
/// covariance information.
Procedure _finalize() {
- return _interfaceResolver.strongMode
+ return !_interfaceResolver.legacyMode
? _computeCovarianceFixes(resolve())
: resolve();
}
@@ -682,10 +682,10 @@
final Instrumentation _instrumentation;
- final bool strongMode;
+ final bool legacyMode;
InterfaceResolver(this._typeInferenceEngine, this._typeEnvironment,
- this._instrumentation, this.strongMode);
+ this._instrumentation, this.legacyMode);
/// Indicates whether the "prepare" phase of type inference is complete.
bool get isTypeInferencePrepared =>
@@ -924,7 +924,7 @@
return;
}
}
- if (strongMode &&
+ if (!legacyMode &&
member.enclosingClass == class_ &&
_requiresTypeInference(member)) {
inferMethodType(library, class_, member, candidates, start + 1, end);
@@ -1067,7 +1067,7 @@
if (resolution is Procedure &&
resolution.isSyntheticForwarder &&
identical(resolution.enclosingClass, class_)) {
- if (strongMode) class_.addMember(resolution);
+ if (!legacyMode) class_.addMember(resolution);
_instrumentation?.record(
class_.location.file,
class_.fileOffset,
@@ -1128,10 +1128,10 @@
Uri fileUri) {
InferenceNode node;
if (procedure.isAccessor && _requiresTypeInference(procedure)) {
- if (strongMode && start < end) {
+ if (!legacyMode && start < end) {
node = new AccessorInferenceNode(
this, procedure, candidates, start, end, library, fileUri);
- } else if (strongMode && crossStart < crossEnd) {
+ } else if (!legacyMode && crossStart < crossEnd) {
node = new AccessorInferenceNode(this, procedure, candidates,
crossStart, crossEnd, library, fileUri);
} else if (procedure is SyntheticAccessor &&
diff --git a/pkg/front_end/test/fasta/type_inference/interface_resolver_test.dart b/pkg/front_end/test/fasta/type_inference/interface_resolver_test.dart
index 97a1d64..cca3905 100644
--- a/pkg/front_end/test/fasta/type_inference/interface_resolver_test.dart
+++ b/pkg/front_end/test/fasta/type_inference/interface_resolver_test.dart
@@ -52,7 +52,7 @@
InterfaceResolver get interfaceResolver {
return cachedInterfaceResolver ??=
- new InterfaceResolver(null, typeEnvironment, null, true);
+ new InterfaceResolver(null, typeEnvironment, null, false);
}
InterfaceType get intType => coreTypes.intClass.rawType;