summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-09-09 13:49:43 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-09-09 13:53:09 +0200
commitb43b3b0ba8ac55ea9c1727b8a4c5e9ad5696fe6d (patch)
treecc74433ef691a5f81af10b099464fc8efb022746 /src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
parentadf2d3632b07eef4fc2303aef994e66584a73f49 (diff)
downloadscala-b43b3b0ba8ac55ea9c1727b8a4c5e9ad5696fe6d.tar.gz
scala-b43b3b0ba8ac55ea9c1727b8a4c5e9ad5696fe6d.tar.bz2
scala-b43b3b0ba8ac55ea9c1727b8a4c5e9ad5696fe6d.zip
SI-6335 More precise location of the implicit class synthetic method.
One approach would be to disallow an implicit class in a template that already has a member with the same name. But this commit doesn't do this; instead it uses `isSynthetic` to find the synthesized implicit conversion method from the potentially overloaded alternatives.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
index 4f597f97c9..83740f1658 100644
--- a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
@@ -369,7 +369,7 @@ trait MethodSynthesis {
}
/** A synthetic method which performs the implicit conversion implied by
- * the declaration of an implicit class. Yet to be written.
+ * the declaration of an implicit class.
*/
case class ImplicitClassWrapper(tree: ClassDef) extends DerivedFromClassDef {
def completer(sym: Symbol): Type = ??? // not needed
@@ -377,7 +377,7 @@ trait MethodSynthesis {
def derivedSym: Symbol = {
// Only methods will do! Don't want to pick up any stray
// companion objects of the same name.
- val result = enclClass.info decl name suchThat (_.isMethod)
+ val result = enclClass.info decl name suchThat (x => x.isMethod && x.isSynthetic)
assert(result != NoSymbol, "not found: "+name+" in "+enclClass+" "+enclClass.info.decls)
result
}