summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-11-15 07:28:19 -0800
committerPaul Phillips <paulp@improving.org>2012-11-15 07:28:19 -0800
commit4444369ddf39176dcfae4bcf1901697a6ccdfd42 (patch)
tree8185867c2809f115325c9589d06a220f8d8c5367 /src
parentbc60605e182d526e4224c804d218e9a0e2952b72 (diff)
parent6023706458ca14ecd62a0b1b68352662e787020f (diff)
downloadscala-4444369ddf39176dcfae4bcf1901697a6ccdfd42.tar.gz
scala-4444369ddf39176dcfae4bcf1901697a6ccdfd42.tar.bz2
scala-4444369ddf39176dcfae4bcf1901697a6ccdfd42.zip
Merge pull request #1629 from paulp/issue/6355
Error for SI-6355, overloading of applyDynamic.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala9
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index dbd2a0e49b..24b0611d6a 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -130,6 +130,15 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
}
}
}
+
+ // Check for doomed attempt to overload applyDynamic
+ if (clazz isSubClass DynamicClass) {
+ clazz.info member nme.applyDynamic match {
+ case sym if sym.isOverloaded => unit.error(sym.pos, "implementation restriction: applyDynamic cannot be overloaded")
+ case _ =>
+ }
+ }
+
if (settings.lint.value) {
clazz.info.decls filter (x => x.isImplicit && x.typeParams.nonEmpty) foreach { sym =>
val alts = clazz.info.decl(sym.name).alternatives
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f5e9540d28..0539735a51 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3871,7 +3871,7 @@ trait Typers extends Modes with Adaptations with Tags {
*
*/
def mkInvoke(cxTree: Tree, tree: Tree, qual: Tree, name: Name): Option[Tree] = {
- debuglog(s"mkInvoke($cxTree, $tree, $qual, $name)")
+ debuglog(s"dyna.mkInvoke($cxTree, $tree, $qual, $name)")
acceptsApplyDynamicWithType(qual, name) map { tp =>
// tp eq NoType => can call xxxDynamic, but not passing any type args (unless specified explicitly by the user)
// in scala-virtualized, when not NoType, tp is passed as type argument (for selection on a staged Struct)