| Index: tests/language/mixin_bound_test.dart
|
| diff --git a/tests/language/mixin_bound_test.dart b/tests/language/mixin_bound_test.dart
|
| index 3bef029920ae0d6b9108528fbf465f8d39f2bf10..23b4e29ab0fa162695105fdd3a37ab4c35116821 100644
|
| --- a/tests/language/mixin_bound_test.dart
|
| +++ b/tests/language/mixin_bound_test.dart
|
| @@ -26,16 +26,16 @@ abstract class AbstractNumber {
|
| // library evaluator;
|
|
|
| abstract class ExpressionWithEval {
|
| - int get eval;
|
| + int get eval;
|
| }
|
|
|
| abstract class AdditionWithEval<E extends ExpressionWithEval> {
|
| - E get operand1;
|
| - E get operand2;
|
| - int get eval => operand1.eval + operand2.eval;
|
| + E get operand1;
|
| + E get operand2;
|
| + int get eval => operand1.eval + operand2.eval;
|
| }
|
|
|
| -abstract class SubtractionWithEval<E extends ExpressionWithEval>{
|
| +abstract class SubtractionWithEval<E extends ExpressionWithEval> {
|
| E get operand1;
|
| E get operand2;
|
| int get eval => operand1.eval - operand2.eval;
|
| @@ -51,7 +51,6 @@ abstract class NumberWithEval {
|
| abstract class AbstractMultiplication<E> {
|
| E operand1, operand2;
|
| AbstractMultiplication(this.operand1, this.operand2);
|
| -
|
| }
|
|
|
| // library multiplicationEvaluator;
|
| @@ -67,16 +66,18 @@ abstract class MultiplicationWithEval<E extends ExpressionWithEval> {
|
| // library string_converter;
|
|
|
| abstract class ExpressionWithStringConversion {
|
| - String toString();
|
| + String toString();
|
| }
|
|
|
| -abstract class AdditionWithStringConversion<E extends ExpressionWithStringConversion> {
|
| +abstract class AdditionWithStringConversion<
|
| + E extends ExpressionWithStringConversion> {
|
| E get operand1;
|
| E get operand2;
|
| - String toString() =>'($operand1 + $operand2))';
|
| + String toString() => '($operand1 + $operand2))';
|
| }
|
|
|
| -abstract class SubtractionWithStringConversion<E extends ExpressionWithStringConversion> {
|
| +abstract class SubtractionWithStringConversion<
|
| + E extends ExpressionWithStringConversion> {
|
| E get operand1;
|
| E get operand2;
|
| String toString() => '($operand1 - $operand2)';
|
| @@ -87,7 +88,8 @@ abstract class NumberWithStringConversion {
|
| String toString() => val.toString();
|
| }
|
|
|
| -abstract class MultiplicationWithStringConversion<E extends ExpressionWithStringConversion> {
|
| +abstract class MultiplicationWithStringConversion<
|
| + E extends ExpressionWithStringConversion> {
|
| E get operand1;
|
| E get operand2;
|
| String toString() => '($operand1 * $operand2)';
|
| @@ -101,29 +103,31 @@ abstract class MultiplicationWithStringConversion<E extends ExpressionWithString
|
| // import 'multiplicationEvaluator.dart';
|
| // import 'stringConverter.dart';
|
|
|
| -abstract class Expression =
|
| - AbstractExpression with ExpressionWithEval, ExpressionWithStringConversion;
|
| -
|
| -class Addition =
|
| - AbstractAddition<Expression> with AdditionWithEval<Expression>,
|
| - AdditionWithStringConversion<Expression> implements Expression;
|
| -
|
| -class Subtraction =
|
| - AbstractSubtraction<Expression> with SubtractionWithEval<Expression>,
|
| - SubtractionWithStringConversion<Expression> implements Expression;
|
| +abstract class Expression = AbstractExpression
|
| + with ExpressionWithEval, ExpressionWithStringConversion;
|
|
|
| -class Number =
|
| - AbstractNumber with NumberWithEval,
|
| - NumberWithStringConversion implements Expression;
|
| +class Addition = AbstractAddition<Expression>
|
| + with AdditionWithEval<Expression>, AdditionWithStringConversion<Expression>
|
| + implements Expression;
|
|
|
| +class Subtraction = AbstractSubtraction<Expression>
|
| + with
|
| + SubtractionWithEval<Expression>,
|
| + SubtractionWithStringConversion<Expression>
|
| + implements Expression;
|
|
|
| -class Multiplication =
|
| - AbstractMultiplication<Expression> with MultiplicationWithEval<Expression>,
|
| - MultiplicationWithStringConversion<Expression> implements Expression;
|
| +class Number = AbstractNumber
|
| + with NumberWithEval, NumberWithStringConversion
|
| + implements Expression;
|
|
|
| +class Multiplication = AbstractMultiplication<Expression>
|
| + with
|
| + MultiplicationWithEval<Expression>,
|
| + MultiplicationWithStringConversion<Expression>
|
| + implements Expression;
|
|
|
| void main() {
|
| Expression e = new Multiplication(new Addition(new Number(4), new Number(2)),
|
| - new Subtraction(new Number(10), new Number(7)));
|
| + new Subtraction(new Number(10), new Number(7)));
|
| Expect.equals('((4 + 2)) * (10 - 7)) = 18', '$e = ${e.eval}');
|
| }
|
|
|