diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 20:12:25 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:04 +0200 |
commit | 1e48758ad5c100a7dd4d1a5b846ef5ff37e37721 (patch) | |
tree | fd5e516a574cd392002995f9ea17e2ee9d4ed801 /src/dotty/tools/dotc/core/classfile | |
parent | 65c26bacbba91850922cfffabfbc6847102bc489 (diff) | |
download | dotty-1e48758ad5c100a7dd4d1a5b846ef5ff37e37721.tar.gz dotty-1e48758ad5c100a7dd4d1a5b846ef5ff37e37721.tar.bz2 dotty-1e48758ad5c100a7dd4d1a5b846ef5ff37e37721.zip |
Refactor handling of unpickled type params
Under the new hk scheme we discovered that type parameters
are sometimes unpickled in the wrong order. The fault was always
present but the previous hk schemes were somehow lenient
enough in their subtyping rules to not discover the problem.
E.g., when reading Coder.scala, dotc believed that parameter
`A` of `TraversableOnce#BufferedCanBuildFrom` is higher-kinded
and parameter `CC` is first-order where the opposite is true.
This commit hardens the way we read type parameters in order
to make this swap impossible by design.
- Revert auto-healing in derivedAppliedType
The healing hid a real error about order of type parameters
in Scala2 unpickling which was fixed in the previous commits.
The healing caused Map.scala to fail because it is possible
that type parameters are mis-prediced to be Nil in an F-bounded
context.
- Smallish fixes to type applications
Diffstat (limited to 'src/dotty/tools/dotc/core/classfile')
-rw-r--r-- | src/dotty/tools/dotc/core/classfile/ClassfileParser.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 2d7b037b1..813376655 100644 --- a/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -389,7 +389,7 @@ class ClassfileParser( } index += 1 } - val ownTypeParams = newTParams.toList + val ownTypeParams = newTParams.toList.asInstanceOf[List[TypeSymbol]] val tpe = if ((owner == null) || !owner.isClass) sig2type(tparams, skiptvs = false) @@ -584,7 +584,7 @@ class ClassfileParser( * a vararg argument. We solve this by creating two constructors, one with * an array, the other with a repeated parameter. */ - def addAnnotationConstructor(classInfo: Type, tparams: List[Symbol] = Nil)(implicit ctx: Context): Unit = { + def addAnnotationConstructor(classInfo: Type, tparams: List[TypeSymbol] = Nil)(implicit ctx: Context): Unit = { def addDefaultGetter(attr: Symbol, n: Int) = ctx.newSymbol( owner = moduleRoot.symbol, |