From 4f937e1735574ffda679761a0a9a8bebbe9cb2ae Mon Sep 17 00:00:00 2001 From: Abel Nieto Date: Fri, 31 Mar 2017 09:14:27 -0400 Subject: Fix #1959: infix type operators in the REPL Infix type operators were broken in the REPL. The REPL uses fold methods from the untpd package, but those were skipping the operator subtree when folding over an InfixOp. Fix the issue by taking the operator into account. Tested: 1) Verified that only the REPL code uses the modified fold method. 2) Added repl test. --- compiler/src/dotty/tools/dotc/ast/untpd.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/ast') diff --git a/compiler/src/dotty/tools/dotc/ast/untpd.scala b/compiler/src/dotty/tools/dotc/ast/untpd.scala index 8ca91590f..c253af852 100644 --- a/compiler/src/dotty/tools/dotc/ast/untpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/untpd.scala @@ -526,11 +526,11 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo { case Function(args, body) => this(this(x, args), body) case InfixOp(left, op, right) => - this(this(x, left), right) + this(this(this(x, left), op), right) case PostfixOp(od, op) => - this(x, od) + this(this(x, od), op) case PrefixOp(op, od) => - this(x, od) + this(this(x, op), od) case Parens(t) => this(x, t) case Tuple(trees) => -- cgit v1.2.3