Skip to content

Commit 6d63321

Browse files
committed
Eliminate MethodOrPoly
Replace with LambdaType
1 parent 60dec6d commit 6d63321

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,16 +2331,14 @@ object Types {
23312331
}
23322332
}
23332333

2334-
trait MethodOrPoly extends MethodicType
2335-
23362334
/** The lambda type square:
23372335
*
23382336
* LambdaType | TermLambda | TypeLambda
23392337
* ------------+-------------------+------------------
23402338
* HKLambda | HKTermLambda | HKTypeLambda
23412339
* StarLambda | MethodType | PolyType
23422340
*/
2343-
trait LambdaType extends BindingType with MethodOrPoly { self =>
2341+
trait LambdaType extends BindingType with MethodicType { self =>
23442342
type ThisName <: Name
23452343
type PInfo <: Type
23462344
type This <: LambdaType{type PInfo = self.PInfo}

compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class VCInlineMethods extends MiniPhaseTransform with IdentityDenotTransformer {
8686
* by a call to the corresponding extension method, otherwise return it as is.
8787
*/
8888
private def rewireIfNeeded(tree: Tree)(implicit ctx: Context) = tree.tpe.widen match {
89-
case tp: MethodOrPoly =>
89+
case tp: LambdaType =>
9090
tree // The rewiring will be handled by a fully-applied parent node
9191
case _ =>
9292
if (isMethodWithExtension(tree.symbol))

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
10521052
if (tp1.isVarArgsMethod && tp2.isVarArgsMethod) tp1.paramInfos map repeatedToSingle
10531053
else tp1.paramInfos
10541054
isApplicable(alt2, formals1, WildcardType) ||
1055-
tp1.paramInfos.isEmpty && tp2.isInstanceOf[MethodOrPoly]
1055+
tp1.paramInfos.isEmpty && tp2.isInstanceOf[LambdaType]
10561056
case tp1: PolyType => // (2)
10571057
val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags, tp1.instantiateBounds)
10581058
isAsSpecific(alt1, tp1.instantiate(tparams map (_.typeRef)), alt2, tp2)

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
17411741
def adapt(tree: Tree, pt: Type, original: untpd.Tree = untpd.EmptyTree)(implicit ctx: Context): Tree = /*>|>*/ track("adapt") /*<|<*/ {
17421742
/*>|>*/ ctx.traceIndented(i"adapting $tree of type ${tree.tpe} to $pt", typr, show = true) /*<|<*/ {
17431743
if (tree.isDef) interpolateUndetVars(tree, tree.symbol)
1744-
else if (!tree.tpe.widen.isInstanceOf[MethodOrPoly]) interpolateUndetVars(tree, NoSymbol)
1744+
else if (!tree.tpe.widen.isInstanceOf[LambdaType]) interpolateUndetVars(tree, NoSymbol)
17451745
tree.overwriteType(tree.tpe.simplified)
17461746
adaptInterpolated(tree, pt, original)
17471747
}

0 commit comments

Comments
 (0)