aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-07-22 15:05:39 +0200
committerMartin Odersky <odersky@gmail.com>2013-07-22 15:05:39 +0200
commit4b265ca213d066897db3a2333a3ac1420e8a480f (patch)
treee360731eacf61c0fafa9c9a84939ddede0fa0cd5 /src/dotty/tools/dotc/core/Types.scala
parent1ed37543f0dc893ba697c212c310063541018f5c (diff)
downloaddotty-4b265ca213d066897db3a2333a3ac1420e8a480f.tar.gz
dotty-4b265ca213d066897db3a2333a3ac1420e8a480f.tar.bz2
dotty-4b265ca213d066897db3a2333a3ac1420e8a480f.zip
Added eta-expansion.
Also: made RepeatedParamTypes aliases of their underlying types, in order to avoid any incompatibilities.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index ef06c37f7..26886ed1d 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -153,7 +153,7 @@ object Types {
final def occursIn(that: Type): Boolean = that.existsPart(this == _)
def isRepeatedParam(implicit ctx: Context): Boolean =
- defn.RepeatedParamClasses contains typeSymbol
+ defn.RepeatedParamAliases contains typeSymbol
// ----- Higher-order combinators -----------------------------------
@@ -544,6 +544,13 @@ object Types {
final def objToAny(implicit ctx: Context) =
if (isClassType(defn.ObjectClass) && !ctx.phase.erasedTypes) defn.AnyType else this
+ /** If this is repeated parameter type, its underlying type,
+ * else the type itself.
+ */
+ def underlyingIfRepeated(implicit ctx: Context): Type =
+ if (isRepeatedParam) dealias else this
+
+
// ----- Access to parts --------------------------------------------
/** The normalized prefix of this type is: