From a727c6fc198d33842ff85d8a16d48143a6757d51 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 30 Jul 2012 13:17:17 +0200 Subject: SI-5732 members and derivatives now return Scope Firstly this unifies the reflection API - now both decls and members return Scope (not Scope and List[Symbol] as it were before). Secondly this fixes SI-5732 without having to sort the result of members. Type.members now returns Scope, a distinguished type, which has the `sorted` method, which does the required sorting if necessary. Also removes nonPrivateMembers and nonPrivateDeclarations to keep the API minimalistic (as can be seen from their implementation in internal.Types they are just members and decls with bridges and private members removed). --- src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 3518316fbb..9501998152 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -122,7 +122,7 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R val defaultGetters = clazz.info.findMembers(0L, DEFAULTPARAM) val defaultMethodNames = defaultGetters map (sym => nme.defaultGetterToMethod(sym.name)) - defaultMethodNames.distinct foreach { name => + defaultMethodNames.toList.distinct foreach { name => val methods = clazz.info.findMember(name, 0L, METHOD, false).alternatives val haveDefaults = methods filter (sym => sym.hasParamWhich(_.hasDefault) && !nme.isProtectedAccessorName(sym.name)) @@ -628,7 +628,7 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R matchingArity match { // So far so good: only one candidate method - case concrete :: Nil => + case Scope(concrete) => val mismatches = abstractParams zip concrete.tpe.paramTypes filterNot { case (x, y) => x =:= y } mismatches match { // Only one mismatched parameter: say something useful. -- cgit v1.2.3