diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-10 11:33:03 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-10 11:33:03 -0700 |
commit | 2ba98d18e216fbba378480ac6d790c5bea89f0b1 (patch) | |
tree | d9f8bfcdbe467dd540529ce7c364a7c65ed9369a /src | |
parent | 19e783b655576ecf2a32d2d0704657ba14940c8a (diff) | |
parent | ed723738e643035609efda49e6be689e4b0b0480 (diff) | |
download | scala-2ba98d18e216fbba378480ac6d790c5bea89f0b1.tar.gz scala-2ba98d18e216fbba378480ac6d790c5bea89f0b1.tar.bz2 scala-2ba98d18e216fbba378480ac6d790c5bea89f0b1.zip |
Merge pull request #1277 from som-snytt/issue-2.10/6278-inline-class-synth-def
SI-6278 fixed: synthetic implicit def must sort with its associated impl...
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 21d61ff7b1..d055c6ec48 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2743,12 +2743,18 @@ trait Typers extends Modes with Adaptations with Tags { // this code by associating defaults and companion objects // with the original tree instead of the new symbol. def matches(stat: Tree, synt: Tree) = (stat, synt) match { + // synt is default arg for stat case (DefDef(_, statName, _, _, _, _), DefDef(mods, syntName, _, _, _, _)) => mods.hasDefaultFlag && syntName.toString.startsWith(statName.toString) + // synt is companion module case (ClassDef(_, className, _, _), ModuleDef(_, moduleName, _)) => className.toTermName == moduleName + // synt is implicit def for implicit class (#6278) + case (ClassDef(cmods, cname, _, _), DefDef(dmods, dname, _, _, _, _)) => + cmods.isImplicit && dmods.isImplicit && cname.toTermName == dname + case _ => false } |