summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/api/Types.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-28 18:21:21 +0300
committerEugene Burmako <xeno.by@gmail.com>2014-02-14 14:16:44 +0100
commitbe22698fa2c1cf368efc8d2cf0f63100c6d0afdc (patch)
treebca11260a7dc1a6dc79df93ccd73bc38fc5dc4be /src/reflect/scala/reflect/api/Types.scala
parentd2365235b6b4252724c43addc7d867c35d558a39 (diff)
downloadscala-be22698fa2c1cf368efc8d2cf0f63100c6d0afdc.tar.gz
scala-be22698fa2c1cf368efc8d2cf0f63100c6d0afdc.tar.bz2
scala-be22698fa2c1cf368efc8d2cf0f63100c6d0afdc.zip
adds Type.companionType
Introduces a dedicated facility to go from a type to a type of its companion. Previously we had to do something really horrible for that, something like: tp.typeSymbol.companionSymbol.typeSignature.
Diffstat (limited to 'src/reflect/scala/reflect/api/Types.scala')
-rw-r--r--src/reflect/scala/reflect/api/Types.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/api/Types.scala b/src/reflect/scala/reflect/api/Types.scala
index 9e868c2b34..2900b7ab3d 100644
--- a/src/reflect/scala/reflect/api/Types.scala
+++ b/src/reflect/scala/reflect/api/Types.scala
@@ -121,6 +121,11 @@ trait Types {
*/
def members: MemberScope
+ /** Type signature of the companion of the underlying class symbol.
+ * NoType if the underlying symbol is not a class symbol, or if it doesn't have a companion.
+ */
+ def companionType: Type
+
/** Is this type a type constructor that is missing its type arguments?
*/
def takesTypeArgs: Boolean