diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 20:26:08 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:06 +0200 |
commit | ae360e93ad7f657992fc305e1b0755ef3ff0f166 (patch) | |
tree | 1470c75977f959f8552264fc006665bb97555fec /src/dotty/tools/dotc/core/Types.scala | |
parent | 6bd7ba9ea4484ee2065dd16077cba6c26b2050d9 (diff) | |
download | dotty-ae360e93ad7f657992fc305e1b0755ef3ff0f166.tar.gz dotty-ae360e93ad7f657992fc305e1b0755ef3ff0f166.tar.bz2 dotty-ae360e93ad7f657992fc305e1b0755ef3ff0f166.zip |
Handle signatures over uninstantiated type variables
Taking the signature over a type with uninstantiated type variables
means that the signature can change later, once we instantiate the
type variable. We handle this by recording uninstantiated positions
of signatures and fixing them in PostTyper, when type variables are
instantiated.
- This allows to drop the kludge of "normalizing" in derivedRefinedType
Dropping this initially revealed the problems with under-determined
signatures. Now that these problems are fixed, we can drop for good.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 9150925ff..d78bbd49e 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2108,15 +2108,7 @@ object Types { def derivedRefinedType(parent: Type, refinedName: Name, refinedInfo: Type)(implicit ctx: Context): Type = if ((parent eq this.parent) && (refinedName eq this.refinedName) && (refinedInfo eq this.refinedInfo)) this - else { - // `normalizedRefinedInfo` is `refinedInfo` reduced everywhere via `reduceProjection`. - // (this is achieved as a secondary effect of substRecThis). - // It turns out this normalization is now needed; without it there's - // A Y-check error (incompatible types involving hk lambdas) for dotty itself. - // TODO: investigate and, if possible, drop after revision. - val normalizedRefinedInfo = refinedInfo.substRecThis(dummyRec, dummyRec) - RefinedType(parent, refinedName, normalizedRefinedInfo) - } + else RefinedType(parent, refinedName, refinedInfo) /** Add this refinement to `parent`, provided If `refinedName` is a member of `parent`. */ def wrapIfMember(parent: Type)(implicit ctx: Context): Type = @@ -2338,7 +2330,7 @@ object Types { final override def signature(implicit ctx: Context): Signature = { if (ctx.runId != mySignatureRunId) { mySignature = computeSignature - mySignatureRunId = ctx.runId + if (!mySignature.isUnderDefined) mySignatureRunId = ctx.runId } mySignature } |