Change parameter 'silent' => 'instrumented'
This requires flipping the default value from false to true. I can
never remember what "silent" entails. It sounds like it might
suppress some error reporting, but what it actually does is suppress
the instrumentation used for checking comments in the test input
files.
Hopefully this name is more obvious.
Change-Id: I922c7107eae32a5d4206aaa6d4507310289ca64d
Reviewed-on: https://dart-review.googlesource.com/c/81261
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
index 02dfd9d..be9f445 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -511,8 +511,8 @@
InvocationExpression read = node.read;
DartType readType;
if (read != null) {
- var readMember =
- inferrer.findMethodInvocationMember(receiverType, read, silent: true);
+ var readMember = inferrer.findMethodInvocationMember(receiverType, read,
+ instrumented: false);
var calleeFunctionType = inferrer.getCalleeFunctionType(
inferrer.getCalleeType(readMember, receiverType), false);
inferrer.ensureAssignable(
@@ -956,8 +956,8 @@
DartType readType;
if (node.read != null) {
- var readMember =
- inferrer.findPropertyGetMember(receiverType, node.read, silent: true);
+ var readMember = inferrer.findPropertyGetMember(receiverType, node.read,
+ instrumented: false);
readType = inferrer.getCalleeType(readMember, receiverType);
inferrer.handlePropertyGetContravariance(
node.receiver,
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 07bc40e..80afd41 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -425,8 +425,8 @@
DartType combinedType;
if (combiner != null) {
bool isOverloadedArithmeticOperator = false;
- combinerMember =
- inferrer.findMethodInvocationMember(readType, combiner, silent: true);
+ combinerMember = inferrer.findMethodInvocationMember(readType, combiner,
+ instrumented: false);
if (combinerMember is Procedure) {
isOverloadedArithmeticOperator = inferrer.typeSchemaEnvironment
.isOverloadedArithmeticOperatorAndType(combinerMember, readType);
@@ -485,7 +485,7 @@
MethodInvocation equalsInvocation = nullAwareCombiner.condition;
inferrer.findMethodInvocationMember(
greatestClosure(inferrer.coreTypes, writeContext), equalsInvocation,
- silent: true);
+ instrumented: false);
// Note: the case of readType=null only happens for erroneous code.
combinedType = readType == null
? rhsType
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 0e60ad4..5b2dfa6 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -774,7 +774,7 @@
Expression expression,
Expression receiver,
bool setter: false,
- bool silent: false}) {
+ bool instrumented: true}) {
assert(receiverType != null && isKnown(receiverType));
// Our non-strong golden files currently don't include interface
@@ -792,7 +792,7 @@
? receiverType.classNode
: coreTypes.objectClass;
Member interfaceMember = _getInterfaceMember(classNode, name, setter);
- if (!silent &&
+ if (instrumented &&
receiverType != const DynamicType() &&
interfaceMember != null) {
instrumentation?.record(uri, fileOffset, 'target',
@@ -830,7 +830,7 @@
/// [methodInvocation].
Object findMethodInvocationMember(
DartType receiverType, InvocationExpression methodInvocation,
- {bool silent: false}) {
+ {bool instrumented: true}) {
// TODO(paulberry): could we add getters to InvocationExpression to make
// these is-checks unnecessary?
if (methodInvocation is MethodInvocation) {
@@ -839,7 +839,7 @@
errorTemplate: templateUndefinedMethod,
expression: methodInvocation,
receiver: methodInvocation.receiver,
- silent: silent);
+ instrumented: instrumented);
if (receiverType == const DynamicType() && interfaceMember is Procedure) {
var arguments = methodInvocation.arguments;
var signature = interfaceMember.function;
@@ -854,7 +854,7 @@
return null;
}
}
- if (instrumentation != null && !silent) {
+ if (instrumented && instrumentation != null) {
instrumentation.record(uri, methodInvocation.fileOffset, 'target',
new InstrumentationValueForMember(interfaceMember));
}
@@ -867,7 +867,7 @@
assert(receiverType != const DynamicType());
var interfaceMember = findInterfaceMember(
receiverType, methodInvocation.name, methodInvocation.fileOffset,
- silent: silent);
+ instrumented: instrumented);
if (strongMode && interfaceMember is Member) {
methodInvocation.interfaceTarget = interfaceMember;
}
@@ -881,7 +881,7 @@
/// Finds a member of [receiverType] called [name], and if it is found,
/// reports it through instrumentation and records it in [propertyGet].
Object findPropertyGetMember(DartType receiverType, Expression propertyGet,
- {bool silent: false}) {
+ {bool instrumented: true}) {
// TODO(paulberry): could we add a common base class to PropertyGet and
// SuperPropertyGet to make these is-checks unnecessary?
if (propertyGet is PropertyGet) {
@@ -890,10 +890,10 @@
errorTemplate: templateUndefinedGetter,
expression: propertyGet,
receiver: propertyGet.receiver,
- silent: silent);
+ instrumented: instrumented);
if (strongMode && interfaceMember is Member) {
- if (instrumentation != null &&
- !silent &&
+ if (instrumented &&
+ instrumentation != null &&
receiverType == const DynamicType()) {
instrumentation.record(uri, propertyGet.fileOffset, 'target',
new InstrumentationValueForMember(interfaceMember));
@@ -905,7 +905,7 @@
assert(receiverType != const DynamicType());
var interfaceMember = findInterfaceMember(
receiverType, propertyGet.name, propertyGet.fileOffset,
- silent: silent);
+ instrumented: instrumented);
if (strongMode && interfaceMember is Member) {
propertyGet.interfaceTarget = interfaceMember;
}
@@ -919,7 +919,7 @@
/// Finds a member of [receiverType] called [name], and if it is found,
/// reports it through instrumentation and records it in [propertySet].
Object findPropertySetMember(DartType receiverType, Expression propertySet,
- {bool silent: false}) {
+ {bool instrumented: true}) {
if (propertySet is PropertySet) {
var interfaceMember = findInterfaceMember(
receiverType, propertySet.name, propertySet.fileOffset,
@@ -927,10 +927,10 @@
expression: propertySet,
receiver: propertySet.receiver,
setter: true,
- silent: silent);
+ instrumented: instrumented);
if (strongMode && interfaceMember is Member) {
- if (instrumentation != null &&
- !silent &&
+ if (instrumented &&
+ instrumentation != null &&
receiverType == const DynamicType()) {
instrumentation.record(uri, propertySet.fileOffset, 'target',
new InstrumentationValueForMember(interfaceMember));
@@ -942,7 +942,7 @@
assert(receiverType != const DynamicType());
var interfaceMember = findInterfaceMember(
receiverType, propertySet.name, propertySet.fileOffset,
- setter: true, silent: silent);
+ setter: true, instrumented: instrumented);
if (strongMode && interfaceMember is Member) {
propertySet.interfaceTarget = interfaceMember;
}
@@ -1592,17 +1592,15 @@
if (strongMode) {
receiverVariable?.type = receiverType;
}
- bool isOverloadedArithmeticOperator = false;
if (desugaredInvocation != null) {
interfaceMember =
findMethodInvocationMember(receiverType, desugaredInvocation);
methodName = desugaredInvocation.name;
arguments = desugaredInvocation.arguments;
}
- if (interfaceMember is Procedure) {
- isOverloadedArithmeticOperator = typeSchemaEnvironment
- .isOverloadedArithmeticOperatorAndType(interfaceMember, receiverType);
- }
+ bool isOverloadedArithmeticOperator = interfaceMember is Procedure &&
+ typeSchemaEnvironment.isOverloadedArithmeticOperatorAndType(
+ interfaceMember, receiverType);
var calleeType = getCalleeType(interfaceMember, receiverType);
var functionType = getCalleeFunctionType(calleeType, !isImplicitCall);
if (interfaceMember != null &&