diff --git a/docs/SyntaxSummary.txt b/docs/SyntaxSummary.txt index f07335d1d2a3..6c83c71abece 100644 --- a/docs/SyntaxSummary.txt +++ b/docs/SyntaxSummary.txt @@ -105,7 +105,7 @@ grammar. WithType ::= AnnotType {`with' AnnotType} (deprecated) AnnotType ::= SimpleType {Annotation} Annotated(t, annot) SimpleType ::= SimpleType (TypeArgs | NamedTypeArgs) AppliedTypeTree(t, args) - | SimpleType `#' id SelectFromTypeTree(t, name) + | SimpleType `#' id Select(t, name) | StableId | Path `.' `type' SingletonTypeTree(p) | `(' ArgTypes ')' Tuple(ts) diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala index 1bfbcdbeb5c8..edd6da5c90b8 100644 --- a/src/dotty/tools/dotc/ast/Desugar.scala +++ b/src/dotty/tools/dotc/ast/Desugar.scala @@ -11,10 +11,6 @@ import collection.mutable.ListBuffer import util.Attachment object desugar { - - /** Are we using the new unboxed pair scheme? */ - private final val unboxedPairs = false - import untpd._ /** Tags a .withFilter call generated by desugaring a for expression. @@ -923,25 +919,15 @@ object desugar { case Parens(t) => t case Tuple(ts) => - if (unboxedPairs) { - def PairTypeTree(l: Tree, r: Tree) = - AppliedTypeTree(ref(defn.PairType), l :: r :: Nil) - if (ctx.mode is Mode.Type) ts.reduceRight(PairTypeTree) - else if (ts.isEmpty) unitLiteral - else ts.reduceRight(Pair(_, _)) - } - else { - val arity = ts.length - def tupleTypeRef = defn.TupleType(arity) - if (arity > Definitions.MaxTupleArity) { - ctx.error(s"tuple too long (max allowed: ${Definitions.MaxTupleArity})", tree.pos) - unitLiteral - } - else if (arity == 1) ts.head - else if (ctx.mode is Mode.Type) AppliedTypeTree(ref(tupleTypeRef), ts) - else if (arity == 0) unitLiteral - else Apply(ref(tupleTypeRef.classSymbol.companionModule.valRef), ts) - } + val arity = ts.length + def tupleTypeRef = defn.TupleType(arity) + if (arity > Definitions.MaxTupleArity) { + ctx.error(s"tuple too long (max allowed: ${Definitions.MaxTupleArity})", tree.pos) + unitLiteral + } else if (arity == 1) ts.head + else if (ctx.mode is Mode.Type) AppliedTypeTree(ref(tupleTypeRef), ts) + else if (arity == 0) unitLiteral + else Apply(ref(tupleTypeRef.classSymbol.companionModule.valRef), ts) case WhileDo(cond, body) => // {