diff options
author | Paul Phillips <paulp@improving.org> | 2011-11-19 08:39:59 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-11-19 08:39:59 +0000 |
commit | 214c145943ac2c6bf37bd40f5e07e225350201c5 (patch) | |
tree | 9ae086954e4e855e9561bbef0b812d34c82d967c /src/compiler/scala/reflect/internal/Types.scala | |
parent | 334872e33be8385678697f3d670c8102d38cdca7 (diff) | |
download | scala-214c145943ac2c6bf37bd40f5e07e225350201c5.tar.gz scala-214c145943ac2c6bf37bd40f5e07e225350201c5.tar.bz2 scala-214c145943ac2c6bf37bd40f5e07e225350201c5.zip |
Cleanups in TypeApply creation and casting.
There's every hint that it's a requirement that a TypeApply have
non-empty typeArgs, but testing for and handling the empty condition
is done irregularly. Made a mkTypeApply which handles the isEmpty case
(returning "fun" unchanged.) Also unified most of the variations of
casts under one umbrella. Review by moors.
Diffstat (limited to 'src/compiler/scala/reflect/internal/Types.scala')
-rw-r--r-- | src/compiler/scala/reflect/internal/Types.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala index f8255bc846..85a12193a9 100644 --- a/src/compiler/scala/reflect/internal/Types.scala +++ b/src/compiler/scala/reflect/internal/Types.scala @@ -2986,6 +2986,11 @@ A type's typeSymbol should never be inspected directly. /** A creator for type parameterizations that strips empty type parameter lists. * Use this factory method to indicate the type has kind * (it's a polymorphic value) * until we start tracking explicit kinds equivalent to typeFun (except that the latter requires tparams nonEmpty). + * + * PP to AM: I've co-opted this for where I know tparams may well be empty, and + * expecting to get back `tpe` in such cases. Re being "forgiving" below, + * can we instead say this is the canonical creator for polyTypes which + * may or may not be poly? (It filched the standard "canonical creator" name.) */ def polyType(tparams: List[Symbol], tpe: Type): Type = if (tparams nonEmpty) typeFun(tparams, tpe) |