aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-01 13:20:39 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-01 13:20:39 +0100
commit055f12f957ec176323e4e0bf01af51666b9ff433 (patch)
treedc4b4e7fedc92b09e44af5a3bfa3411456f33b23
parent636608afacf943d8b3c05074a6f4de4ca40a4688 (diff)
downloaddotty-055f12f957ec176323e4e0bf01af51666b9ff433.tar.gz
dotty-055f12f957ec176323e4e0bf01af51666b9ff433.tar.bz2
dotty-055f12f957ec176323e4e0bf01af51666b9ff433.zip
Adress reviewers comments
-rw-r--r--compiler/src/dotty/tools/dotc/core/Definitions.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/Erasure.scala23
-rw-r--r--library/src/scala/FunctionXXL.scala8
3 files changed, 14 insertions, 19 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala
index 09485918f..b9ea03661 100644
--- a/compiler/src/dotty/tools/dotc/core/Definitions.scala
+++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala
@@ -685,7 +685,7 @@ class Definitions {
def isFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.Function)
def isUnimplementedFunctionClass(cls: Symbol) =
- isFunctionClass(cls) && cls.name.functionArity >= MaxImplementedFunctionArity
+ isFunctionClass(cls) && cls.name.functionArity > MaxImplementedFunctionArity
def isAbstractFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.AbstractFunction)
def isTupleClass(cls: Symbol) = isVarArityClass(cls, tpnme.Tuple)
def isProductClass(cls: Symbol) = isVarArityClass(cls, tpnme.Product)
diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
index 5dd2e512b..d1f5bd532 100644
--- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
@@ -343,19 +343,22 @@ object Erasure extends TypeTestsCasts{
* e.m -> e.[]m if `m` is an array operation other than `clone`.
*/
override def typedSelect(tree: untpd.Select, pt: Type)(implicit ctx: Context): Tree = {
- val oldSym = tree.symbol
- assert(oldSym.exists)
- val oldOwner = oldSym.owner
- val owner =
- if ((oldOwner eq defn.AnyClass) || (oldOwner eq defn.AnyValClass)) {
- assert(oldSym.isConstructor, s"${oldSym.showLocated}")
+
+ def mapOwner(sym: Symbol): Symbol = {
+ val owner = sym.owner
+ if ((owner eq defn.AnyClass) || (owner eq defn.AnyValClass)) {
+ assert(sym.isConstructor, s"${sym.showLocated}")
defn.ObjectClass
}
- else if (defn.isUnimplementedFunctionClass(oldOwner))
+ else if (defn.isUnimplementedFunctionClass(owner))
defn.FunctionXXLClass
else
- oldOwner
- val sym = if (owner eq oldOwner) oldSym else owner.info.decl(oldSym.name).symbol
+ owner
+ }
+
+ var sym = tree.symbol
+ val owner = mapOwner(sym)
+ if (owner ne sym.owner) sym = owner.info.decl(sym.name).symbol
assert(sym.exists, owner)
def select(qual: Tree, sym: Symbol): Tree = {
@@ -443,7 +446,7 @@ object Erasure extends TypeTestsCasts{
}
}
- /** Besides notmal typing, this method collects all arguments
+ /** Besides normal typing, this method collects all arguments
* to a compacted function into a single argument of array type.
*/
override def typedApply(tree: untpd.Apply, pt: Type)(implicit ctx: Context): Tree = {
diff --git a/library/src/scala/FunctionXXL.scala b/library/src/scala/FunctionXXL.scala
index bc0de4482..25e7af609 100644
--- a/library/src/scala/FunctionXXL.scala
+++ b/library/src/scala/FunctionXXL.scala
@@ -1,11 +1,3 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-// GENERATED CODE: DO NOT EDIT. See scala.Function0 for timestamp.
package scala
/** A function with all parameters grouped in an array. */