From 9d0aa36c879f4bde68e01e0ba9decab21d8fce49 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 10 Mar 2017 19:38:39 +0100 Subject: Construct MethodTypes from parameter closure To allow for dependencies between method type parameters, construct MethodTypes from a closure that maps the currently constructed MethodType to its parameter types. --- .../src/dotty/tools/dotc/core/classfile/ClassfileParser.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala') diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 36d478c6d..bfb4daa71 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -198,8 +198,8 @@ class ClassfileParser( */ def stripOuterParamFromConstructor() = innerClasses.get(currentClassName) match { case Some(entry) if !isStatic(entry.jflags) => - val mt @ MethodType(paramnames, paramtypes) = denot.info - denot.info = mt.derivedMethodType(paramnames.tail, paramtypes.tail, mt.resultType) + val mt @ MethodTpe(paramNames, paramTypes, resultType) = denot.info + denot.info = mt.derivedMethodType(paramNames.tail, paramTypes.tail, resultType) case _ => } @@ -207,9 +207,9 @@ class ClassfileParser( * and make constructor type polymorphic in the type parameters of the class */ def normalizeConstructorInfo() = { - val mt @ MethodType(paramnames, paramtypes) = denot.info + val mt @ MethodType(paramNames) = denot.info val rt = classRoot.typeRef appliedTo (classRoot.typeParams map (_.typeRef)) - denot.info = mt.derivedMethodType(paramnames, paramtypes, rt) + denot.info = mt.derivedMethodType(paramNames, mt.paramTypes, rt) addConstructorTypeParams(denot) } -- cgit v1.2.3