summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-11-14 13:03:28 -0800
committerPaul Phillips <paulp@improving.org>2012-11-14 16:39:19 -0800
commit6023706458ca14ecd62a0b1b68352662e787020f (patch)
tree64f0cfa003110448a98639b95319c742e2db7359 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parented6520b4fa002ea143cead5eb3633839d500e08d (diff)
downloadscala-6023706458ca14ecd62a0b1b68352662e787020f.tar.gz
scala-6023706458ca14ecd62a0b1b68352662e787020f.tar.bz2
scala-6023706458ca14ecd62a0b1b68352662e787020f.zip
Error for SI-6355, overloading of applyDynamic.
As long as it can never be called anyway, seems like we'd be doing people a kindness to fail the compile rather than letting it be ambiguous at every use site.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala9
1 files changed, 9 insertions, 0 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