diff options
author | Martin Odersky <odersky@gmail.com> | 2017-01-10 20:34:38 +0700 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-01-10 20:34:38 +0700 |
commit | 8464c16181474b625a3269e2c5b1f80a4a88482c (patch) | |
tree | 9ca78148d6ebf77650f701ee82c6c0f117d2dd5c /compiler/src/dotty/tools/dotc | |
parent | bb81d5d54bf95a417d555586cff403c4bb76455f (diff) | |
download | dotty-8464c16181474b625a3269e2c5b1f80a4a88482c.tar.gz dotty-8464c16181474b625a3269e2c5b1f80a4a88482c.tar.bz2 dotty-8464c16181474b625a3269e2c5b1f80a4a88482c.zip |
Address reviewer comments
Diffstat (limited to 'compiler/src/dotty/tools/dotc')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Definitions.scala | 2 | ||||
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Dynamic.scala | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 6e67087a3..1a6b04a18 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -27,7 +27,7 @@ object Definitions { */ val MaxImplementedFunctionArity = 22 - /** The maximal arity of a function thta can be accessed as member of a structrual type */ + /** The maximal arity of a function that can be accessed as member of a structural type */ val MaxStructuralMethodArity = 7 } diff --git a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala index 49dd98523..000cfd026 100644 --- a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala +++ b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala @@ -120,7 +120,7 @@ trait Dynamic { self: Typer with Applications => * * If `U` is a method type (T1,...,Tn)R, map `x.a` to the equivalent of: * - * (x: Selectable).selectDynamicMethod(x, "a")(CT1, ..., CTn).asInstanceOf[(T1,...,Tn) => R] + * (x: Selectable).selectDynamicMethod("a", CT1, ..., CTn).asInstanceOf[(T1,...,Tn) => R] * * where CT1,...,CTn are the class tags representing the erasure of T1,...,Tn. * @@ -146,7 +146,8 @@ trait Dynamic { self: Typer with Applications => if (tpe.isDependent) fail(i"has a dependent method type") else if (tpe.paramNames.length > Definitions.MaxStructuralMethodArity) - fail(i"takes too many parameters") + fail(i"""takes too many parameters. + |Structural types only support methods taking up to ${Definitions.MaxStructuralMethodArity} arguments""") else { def issueError(msgFn: String => String): Unit = ctx.error(msgFn(""), tree.pos) val ctags = tpe.paramTypes.map(pt => |