summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-06-24 03:10:26 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-06-24 03:10:26 -0700
commit443562650cb0de1d5cc8a8daa0c35cde0c5d0ce7 (patch)
treef54bc01a9a438be29bbce932be5f647e1bd498a6 /src
parentc1d67247de850876652215cfd61fe6a19dfa5b28 (diff)
parenta2d1b23dbee55a905eecdfeeafad8701b726621b (diff)
downloadscala-443562650cb0de1d5cc8a8daa0c35cde0c5d0ce7.tar.gz
scala-443562650cb0de1d5cc8a8daa0c35cde0c5d0ce7.tar.bz2
scala-443562650cb0de1d5cc8a8daa0c35cde0c5d0ce7.zip
Merge pull request #751 from scalamacros/topic/narrow
SI-5951 add `narrow` to the reflection API
Diffstat (limited to 'src')
-rw-r--r--src/reflect/scala/reflect/api/Types.scala12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/api/Types.scala b/src/reflect/scala/reflect/api/Types.scala
index b62a92cbd7..b797c71f6d 100644
--- a/src/reflect/scala/reflect/api/Types.scala
+++ b/src/reflect/scala/reflect/api/Types.scala
@@ -121,7 +121,7 @@ trait Types extends base.Types { self: Universe =>
* class C extends p.D[Int]
* T.asSeenFrom(ThisType(C), D) (where D is owner of m)
* = Int
- * }}}
+ * }}}
*/
def asSeenFrom(pre: Type, clazz: Symbol): Type
@@ -171,6 +171,15 @@ trait Types extends base.Types { self: Universe =>
*/
def widen: Type
+ /** Map to a singleton type which is a subtype of this type.
+ * The fallback implemented here gives:
+ * {{{
+ * T.narrow = (T {}).this.type
+ * }}}
+ * Overridden where we know more about where types come from.
+ */
+ def narrow: Type
+
/** The string discriminator of this type; useful for debugging */
def kind: String
}
@@ -365,4 +374,3 @@ trait Types extends base.Types { self: Universe =>
*/
def existentialAbstraction(tparams: List[Symbol], tpe0: Type): Type
}
-