diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-01 22:00:41 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-03-01 22:08:17 +0100 |
commit | 58b71ca50ded400efa92ac8d92f4378844baaf7d (patch) | |
tree | dd0814ee5d73996ef6e91e7d4e12c82af883d80b /compiler/src/dotty/tools/dotc/core | |
parent | e01ca04c28e242a5f602dffc28a1b1eae358ecaf (diff) | |
download | dotty-58b71ca50ded400efa92ac8d92f4378844baaf7d.tar.gz dotty-58b71ca50ded400efa92ac8d92f4378844baaf7d.tar.bz2 dotty-58b71ca50ded400efa92ac8d92f4378844baaf7d.zip |
Fix handling of dependent method types
Need to use fresh PolyParams instead of WildcardTypes
if constraint is committable.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Definitions.scala | 1 | ||||
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/StdNames.scala | 1 | ||||
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Types.scala | 6 |
3 files changed, 2 insertions, 6 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 79e97becb..5a2e26099 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -352,6 +352,7 @@ class Definitions { enterCompleteClassSymbol( ScalaPackageClass, tpnme.Singleton, PureInterfaceCreationFlags | Final, List(AnyClass.typeRef), EmptyScope) + def SingletonType = SingletonClass.typeRef lazy val SeqType: TypeRef = ctx.requiredClassRef("scala.collection.Seq") def SeqClass(implicit ctx: Context) = SeqType.symbol.asClass diff --git a/compiler/src/dotty/tools/dotc/core/StdNames.scala b/compiler/src/dotty/tools/dotc/core/StdNames.scala index 1e36361f8..0f1b296b1 100644 --- a/compiler/src/dotty/tools/dotc/core/StdNames.scala +++ b/compiler/src/dotty/tools/dotc/core/StdNames.scala @@ -97,6 +97,7 @@ object StdNames { val EMPTY: N = "" val EMPTY_PACKAGE: N = Names.EMPTY_PACKAGE.toString val EVIDENCE_PARAM_PREFIX: N = "evidence$" + val DEP_PARAM_PREFIX = "<param>" val EXCEPTION_RESULT_PREFIX: N = "exceptionResult" val EXPAND_SEPARATOR: N = "$$" val IMPL_CLASS_SUFFIX: N = "$class" diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 8bd729472..36e0dfb0e 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2394,12 +2394,6 @@ object Types { */ def isDependent(implicit ctx: Context): Boolean = dependencyStatus == TrueDeps - /** The result type where every reference to a parameter is replaced by a Wildcard - */ - def resultTypeApprox(implicit ctx: Context): Type = - if (isDependent) resultType.substParams(this, paramTypes.map(Function.const(WildcardType))) - else resultType - protected def computeSignature(implicit ctx: Context): Signature = resultSignature.prepend(paramTypes, isJava) |