diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 5 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 25 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 3 |
4 files changed, 3 insertions, 34 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index cdbf692cd..caae422d3 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -634,7 +634,6 @@ trait Applications extends Compatibility { self: Typer => typedFn.tpe.widen match { case pt: PolyType => if (typedArgs.length <= pt.paramBounds.length && !isNamed) - typedArgs = typedArgs.zipWithConserve(pt.paramBounds)(adaptTypeArg) if (typedFn.symbol == defn.Predef_classOf && typedArgs.nonEmpty) { val arg = typedArgs.head checkClassType(arg.tpe, arg.pos, traitReq = false, stablePrefixReq = false) @@ -644,9 +643,6 @@ trait Applications extends Compatibility { self: Typer => assignType(cpy.TypeApply(tree)(typedFn, typedArgs), typedFn, typedArgs) } - def adaptTypeArg(tree: tpd.Tree, bound: Type)(implicit ctx: Context): tpd.Tree = - if (Config.newHK) tree else tree.withType(tree.tpe.etaExpandIfHK(bound)) - /** Rewrite `new Array[T](....)` if T is an unbounded generic to calls to newGenericArray. * It is performed during typer as creation of generic arrays needs a classTag. * we rely on implicit search to find one. diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index 1b02f7e70..a5246cf6b 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -284,13 +284,10 @@ trait ImplicitRunInfo { self: RunInfo => override implicit protected val ctx: Context = liftingCtx override def stopAtStatic = true def apply(tp: Type) = tp match { - case tp: TypeRef if tp.symbol.isLambdaTraitOBS => - defn.AnyType case tp: TypeRef if tp.symbol.isAbstractOrAliasType => val pre = tp.prefix def joinClass(tp: Type, cls: ClassSymbol) = - if (cls.isLambdaTraitOBS) tp - else AndType.make(tp, cls.typeRef.asSeenFrom(pre, cls.owner)) + AndType.make(tp, cls.typeRef.asSeenFrom(pre, cls.owner)) val lead = if (tp.prefix eq NoPrefix) defn.AnyType else apply(tp.prefix) (lead /: tp.classSymbols)(joinClass) case tp: TypeVar => diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index bc8f8e281..bf36942e0 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -973,29 +973,6 @@ class Namer { typer: Typer => } ensureUpToDate(sym.typeRef, dummyInfo) ensureUpToDate(sym.typeRef.appliedTo(tparamSyms.map(_.typeRef)), TypeBounds.empty) - - if (Config.newHK) sym.info - else etaExpandArgsOBS.apply(sym.info) - } - - /** Eta expand all class types C appearing as arguments to a higher-kinded - * type parameter to type lambdas, e.g. [HK0] => C[HK0]. This is necessary - * because in `typedAppliedTypeTree` we might have missed some eta expansions - * of arguments in F-bounds, because the recursive type was initialized with - * TypeBounds.empty. - */ - def etaExpandArgsOBS(implicit ctx: Context) = new TypeMap { - def apply(tp: Type): Type = tp match { - case tp: RefinedType => - val args = tp.argInfos.mapconserve(this) - if (args.nonEmpty) { - val tycon = tp.withoutArgs(args) - val tycon1 = this(tycon) - val tparams = tycon.typeParams - val args1 = if (args.length == tparams.length) etaExpandIfHK(tparams, args) else args - if ((tycon1 eq tycon) && (args1 eq args)) tp else tycon1.appliedTo(args1) - } else mapOver(tp) - case _ => mapOver(tp) - } + sym.info } } diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 96bc2ab35..2ab06bf70 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -949,8 +949,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit (if (isVarPattern(arg)) desugar.patternVar(arg) else arg, tparam.memberBounds) else (arg, WildcardType) - val arg1 = typed(desugaredArg, argPt) - adaptTypeArg(arg1, tparam.memberBounds) + typed(desugaredArg, argPt) } args.zipWithConserve(tparams)(typedArg(_, _)).asInstanceOf[List[Tree]] } |