aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-27 18:33:57 +0100
committerMartin Odersky <odersky@gmail.com>2013-10-27 18:33:57 +0100
commit52a8a0aec9da8a4eaa3faf95ec7acd3ecfbabf53 (patch)
tree7f029c717a8f8ea0787f669412ce2047e68a630d /src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
parent41e7d9d46177650d23447f99989e8347aca56e71 (diff)
downloaddotty-52a8a0aec9da8a4eaa3faf95ec7acd3ecfbabf53.tar.gz
dotty-52a8a0aec9da8a4eaa3faf95ec7acd3ecfbabf53.tar.bz2
dotty-52a8a0aec9da8a4eaa3faf95ec7acd3ecfbabf53.zip
Fixed unpickling of polymorphic constructors.
Constructors of parameterized classes now get polymorphic types when unpickled, as is the case when defining them or when reading them from a Java classfile. This caused a ripple of other faults which this commit also fixes.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/ClassfileParser.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/ClassfileParser.scala9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
index b65fc55bb..a641e10cc 100644
--- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
+++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
@@ -174,7 +174,7 @@ class ClassfileParser(
val isEnum = (jflags & JAVA_ACC_ENUM) != 0
val name = pool.getName(in.nextChar)
val isConstructor = name eq nme.CONSTRUCTOR
-
+
/** Strip leading outer param from constructor.
* Todo: Also strip trailing access tag for private inner constructors?
*/
@@ -190,10 +190,9 @@ class ClassfileParser(
*/
def normalizeConstructorInfo() = {
val mt @ MethodType(paramnames, paramtypes) = denot.info
- val typeParams = classRoot.typeParams
- val rt = classRoot.typeConstructor appliedTo (typeParams map (_.symRef))
- denot.info = PolyType.fromSymbols(typeParams,
- mt.derivedMethodType(paramnames, paramtypes, rt))
+ val rt = classRoot.typeConstructor appliedTo (classRoot.typeParams map (_.symRef))
+ denot.info = mt.derivedMethodType(paramnames, paramtypes, rt)
+ addConstructorTypeParams(denot)
}
denot.info = pool.getType(in.nextChar)