diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer/TypeAssigner.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/TypeAssigner.scala | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/typer/TypeAssigner.scala b/src/dotty/tools/dotc/typer/TypeAssigner.scala index 3f3108ac2..27cc0e6f5 100644 --- a/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -4,9 +4,10 @@ package typer import core._ import ast._ +import config.Config.newHK import Scopes._, Contexts._, Constants._, Types._, Symbols._, Names._, Flags._, Decorators._ import ErrorReporting._, Annotations._, Denotations._, SymDenotations._, StdNames._, TypeErasure._ -import TypeApplications.AppliedType +import TypeApplications.{AppliedType, TypeLambdaOLD} import util.Positions._ import config.Printers._ import ast.Trees._ @@ -426,14 +427,16 @@ trait TypeAssigner { tree.withType(ownType) } - def assignType(tree: untpd.TypeLambdaTree, tparamDefs: List[TypeDef], body: Tree)(implicit ctx: Context) = { - val tparams = tparamDefs.map(_.symbol) - val argBindingFns = tparams.map(tparam => - tparam.info.bounds - .withBindingKind(BindingKind.fromVariance(tparam.variance)) - .recursify(tparams)) - val bodyFn = body.tpe.recursify(tparams) - tree.withType(TypeApplications.TypeLambda(argBindingFns, bodyFn)) + def assignType(tree: untpd.TypeLambdaTree, tparamDefs: List[TypeDef], body: Tree)(implicit ctx: Context) = + if (newHK) tree.withType(TypeLambda.fromSymbols(tparamDefs.map(_.symbol), body.tpe)) + else { + val tparams = tparamDefs.map(_.symbol) + val argBindingFns = tparams.map(tparam => + tparam.info.bounds + .withBindingKind(BindingKind.fromVariance(tparam.variance)) + .recursifyOLD(tparams)) + val bodyFn = body.tpe.recursifyOLD(tparams) + tree.withType(TypeLambdaOLD(argBindingFns, bodyFn)) } def assignType(tree: untpd.ByNameTypeTree, result: Tree)(implicit ctx: Context) = |