| Index: pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| index 4c3d53ae8e53c8d184bdf70bcac52627e4e986cd..4336d919eaca55405599ca5ea3f1f6d53c9cc72e 100644
|
| --- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| +++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| @@ -402,14 +402,22 @@ class TypeSchemaEnvironment extends TypeEnvironment {
|
| /// True if [member] is a binary operator that returns an `int` if both
|
| /// operands are `int`, and otherwise returns `double`.
|
| ///
|
| + /// Note that this behavior depends on the receiver type, so we can only make
|
| + /// this determination if we know the type of the receiver.
|
| + ///
|
| /// This is a case of type-based overloading, which in Dart is only supported
|
| /// by giving special treatment to certain arithmetic operators.
|
| - bool isOverloadedArithmeticOperator(Procedure member) {
|
| + bool isOverloadedArithmeticOperatorAndType(
|
| + Procedure member, DartType receiverType) {
|
| // TODO(paulberry): this matches what is defined in the spec. It would be
|
| // nice if we could change kernel to match the spec and not have to
|
| // override.
|
| if (member.name.name == 'remainder') return false;
|
| - return super.isOverloadedArithmeticOperator(member);
|
| + if (!(receiverType is InterfaceType &&
|
| + identical(receiverType.classNode, coreTypes.intClass))) {
|
| + return false;
|
| + }
|
| + return isOverloadedArithmeticOperator(member);
|
| }
|
|
|
| @override
|
|
|