diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-07-04 20:58:50 +0400 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-07-04 20:58:50 +0400 |
commit | 3e9763a3ba0a486adc022c5ee410ec00768cc78d (patch) | |
tree | e3aa3df8901c7f7b21eb9da8ce143a1a31c68c0e | |
parent | cae38dc68d02ac5fa80e2d8994990499dc63e657 (diff) | |
download | scala-3e9763a3ba0a486adc022c5ee410ec00768cc78d.tar.gz scala-3e9763a3ba0a486adc022c5ee410ec00768cc78d.tar.bz2 scala-3e9763a3ba0a486adc022c5ee410ec00768cc78d.zip |
Adds `Type.resultType` to reflection API
Seems to be quite an essential piece of functionality.
Got requests for it from Paul back then, and now Daniel
in his latest blog post has to painfully pattern match
his way to resultType.
-rw-r--r-- | src/reflect/scala/reflect/api/Types.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/api/Types.scala b/src/reflect/scala/reflect/api/Types.scala index b797c71f6d..231b9b248b 100644 --- a/src/reflect/scala/reflect/api/Types.scala +++ b/src/reflect/scala/reflect/api/Types.scala @@ -62,6 +62,10 @@ trait Types extends base.Types { self: Universe => * the empty list for all other types */ def typeParams: List[Symbol] + /** For a (nullary) method or poly type, its direct result type, + * the type itself for all other types. */ + def resultType: Type + /** Is this type a type constructor that is missing its type arguments? */ def isHigherKinded: Boolean // !!! This should be called "isTypeConstructor", no? |