diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-07 14:56:15 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-07 14:56:15 -0700 |
commit | 65a321c63e5ddb77fa87de098c4f7d6f9ce8baa6 (patch) | |
tree | 002939a6f190e8efe8776ad83fcff32b8f1e5c04 /src | |
parent | bfde8c79cf68541e29e60d22371bcc4669be7b83 (diff) | |
parent | c2cf3d77b4a14ea74a573fcc78aeaf64accaa3db (diff) | |
download | scala-65a321c63e5ddb77fa87de098c4f7d6f9ce8baa6.tar.gz scala-65a321c63e5ddb77fa87de098c4f7d6f9ce8baa6.tar.bz2 scala-65a321c63e5ddb77fa87de098c4f7d6f9ce8baa6.zip |
Merge pull request #1470 from scalamacros/topic/paramss
MethodSymbol.params => MethodSymbol.paramss
Diffstat (limited to 'src')
4 files changed, 8 insertions, 9 deletions
diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala index 8b24b953ae..e456428338 100644 --- a/src/reflect/scala/reflect/api/Symbols.scala +++ b/src/reflect/scala/reflect/api/Symbols.scala @@ -540,12 +540,13 @@ trait Symbols { self: Universe => def typeParams: List[Symbol] /** All parameter lists of the method. + * The name ending with "ss" indicates that the result type is a list of lists. * * Can be used to distinguish nullary methods and methods with empty parameter lists. * For a nullary method, returns the empty list (i.e. `List()`). * For a method with an empty parameter list, returns a list that contains the empty list (i.e. `List(List())`). */ - def params: List[List[Symbol]] + def paramss: List[List[Symbol]] /** Does this method support variable length argument lists? */ diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index b132b91946..c95678fa67 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -2599,8 +2599,6 @@ trait Symbols extends api.Symbols { self: SymbolTable => res } - override def params: List[List[Symbol]] = paramss - override def isVarargs: Boolean = definitions.isVarArgsList(paramss.flatten) override def returnType: Type = { diff --git a/src/reflect/scala/reflect/runtime/JavaMirrors.scala b/src/reflect/scala/reflect/runtime/JavaMirrors.scala index b6b2537dc4..ad3fdc8b71 100644 --- a/src/reflect/scala/reflect/runtime/JavaMirrors.scala +++ b/src/reflect/scala/reflect/runtime/JavaMirrors.scala @@ -300,7 +300,7 @@ trait JavaMirrors extends internal.SymbolTable with api.JavaUniverse { thisUnive def showTparams(tparams: List[Symbol]) = "[" + (tparams map showTparam mkString ", ") + "]" sig += showTparams(symbol.typeParams) } - if (symbol.params.nonEmpty) { + if (symbol.paramss.nonEmpty) { def showParam(param: Symbol) = s"${param.name}: ${param.typeSignature}" def showParams(params: List[Symbol]) = { val s_mods = if (params.nonEmpty && params(0).hasFlag(IMPLICIT)) "implicit " else "" @@ -308,7 +308,7 @@ trait JavaMirrors extends internal.SymbolTable with api.JavaUniverse { thisUnive "(" + s_mods + s_params + ")" } def showParamss(paramss: List[List[Symbol]]) = paramss map showParams mkString "" - sig += showParamss(symbol.params) + sig += showParamss(symbol.paramss) } sig += s": ${symbol.returnType}" sig @@ -316,7 +316,7 @@ trait JavaMirrors extends internal.SymbolTable with api.JavaUniverse { thisUnive // the "symbol == Any_getClass || symbol == Object_getClass" test doesn't cut it // because both AnyVal and its primitive descendants define their own getClass methods - private def isGetClass(meth: MethodSymbol) = meth.name.toString == "getClass" && meth.params.flatten.isEmpty + private def isGetClass(meth: MethodSymbol) = meth.name.toString == "getClass" && meth.paramss.flatten.isEmpty private def isStringConcat(meth: MethodSymbol) = meth == String_+ || (meth.owner.isPrimitiveValueClass && meth.returnType =:= StringClass.toType) lazy val bytecodelessMethodOwners = Set[Symbol](AnyClass, AnyValClass, AnyRefClass, ObjectClass, ArrayClass) ++ ScalaPrimitiveValueClasses lazy val bytecodefulObjectMethods = Set[Symbol](Object_clone, Object_equals, Object_finalize, Object_hashCode, Object_toString, @@ -332,7 +332,7 @@ trait JavaMirrors extends internal.SymbolTable with api.JavaUniverse { thisUnive // rather than have them on a hot path them in a unified implementation of the `apply` method private def mkJavaMethodMirror[T: ClassTag](receiver: T, symbol: MethodSymbol): JavaMethodMirror = { if (isBytecodelessMethod(symbol)) new JavaBytecodelessMethodMirror(receiver, symbol) - else if (symbol.params.flatten exists (p => isByNameParamType(p.info))) new JavaByNameMethodMirror(receiver, symbol) + else if (symbol.paramss.flatten exists (p => isByNameParamType(p.info))) new JavaByNameMethodMirror(receiver, symbol) else new JavaVanillaMethodMirror(receiver, symbol) } @@ -361,7 +361,7 @@ trait JavaMirrors extends internal.SymbolTable with api.JavaUniverse { thisUnive private class JavaByNameMethodMirror(val receiver: Any, symbol: MethodSymbol) extends JavaMethodMirror(symbol) { def apply(args: Any*): Any = { - val transformed = map2(args.toList, symbol.params.flatten)((arg, param) => if (isByNameParamType(param.info)) () => arg else arg) + val transformed = map2(args.toList, symbol.paramss.flatten)((arg, param) => if (isByNameParamType(param.info)) () => arg else arg) jinvoke(jmeth, receiver, transformed) } } diff --git a/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala b/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala index 3c2885a9f4..b6bdda5e85 100644 --- a/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala +++ b/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala @@ -110,7 +110,7 @@ trait SynchronizedSymbols extends internal.Symbols { self: SymbolTable => trait SynchronizedMethodSymbol extends MethodSymbol with SynchronizedTermSymbol { override def typeAsMemberOf(pre: Type): Type = synchronized { super.typeAsMemberOf(pre) } - override def params: List[List[Symbol]] = synchronized { super.params } + override def paramss: List[List[Symbol]] = synchronized { super.paramss } override def returnType: Type = synchronized { super.returnType } } |