Skip to content

Commit 1ed6873

Browse files
committed
Drop IntegratedTypeArgs
1 parent 414de7c commit 1ed6873

File tree

3 files changed

+2
-34
lines changed

3 files changed

+2
-34
lines changed

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
645645
keywordStr("${") ~ toTextGlobal(dropBlock(tree)) ~ keywordStr("}")
646646
case TypSplice(tree) =>
647647
keywordStr("${") ~ toTextGlobal(dropBlock(tree)) ~ keywordStr("}")
648-
case tree: Applications.IntegratedTypeArgs =>
649-
toText(tree.app) ~ Str("(with integrated type args)").provided(printDebug)
650648
case tree: Applications.ExtMethodApply =>
651649
toText(tree.app) ~ Str("(ext method apply)").provided(printDebug)
652650
case Thicket(trees) =>

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -206,26 +206,6 @@ object Applications {
206206
def productElement(n: Int): Any = app.productElement(n)
207207
}
208208

209-
/** A wrapper indicating that its `app` argument has already integrated the type arguments
210-
* of the expected type, provided that type is a (possibly ignored) PolyProto.
211-
* I.e., if the expected type is a PolyProto, then `app` will be a `TypeApply(_, args)` where
212-
* `args` are the type arguments of the expected type.
213-
*/
214-
class IntegratedTypeArgs(val app: Tree)(implicit @constructorOnly src: SourceFile) extends AppProxy
215-
216-
/** The unapply method of this extractor also recognizes IntegratedTypeArgs in closure blocks.
217-
* This is necessary to deal with closures as left arguments of extension method applications.
218-
* A test case is i5606.scala
219-
*/
220-
object IntegratedTypeArgs {
221-
def apply(app: Tree)(using Context) = new IntegratedTypeArgs(app)
222-
def unapply(tree: Tree)(using Context): Option[Tree] = tree match {
223-
case tree: IntegratedTypeArgs => Some(tree.app)
224-
case Block(stats, IntegratedTypeArgs(app)) => Some(tpd.cpy.Block(tree)(stats, app))
225-
case _ => None
226-
}
227-
}
228-
229209
/** A wrapper indicating that its argument is an application of an extension method.
230210
*/
231211
class ExtMethodApply(val app: Tree)(implicit @constructorOnly src: SourceFile) extends AppProxy:
@@ -1061,8 +1041,6 @@ trait Applications extends Compatibility {
10611041
val typedArgs = if (isNamed) typedNamedArgs(tree.args) else tree.args.mapconserve(typedType(_))
10621042
record("typedTypeApply")
10631043
typedExpr(tree.fun, PolyProto(typedArgs, pt)) match {
1064-
case IntegratedTypeArgs(app) =>
1065-
app
10661044
case _: TypeApply if !ctx.isAfterTyper =>
10671045
errorTree(tree, "illegal repeated type application")
10681046
case typedFn =>

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import TypeComparer.CompareResult
3030
import util.Spans._
3131
import util.common._
3232
import util.{Property, SimpleIdentityMap, SrcPos}
33-
import Applications.{ExtMethodApply, IntegratedTypeArgs, productSelectorTypes, wrapDefs}
33+
import Applications.{ExtMethodApply, productSelectorTypes, wrapDefs}
3434

3535
import collection.mutable
3636
import annotation.tailrec
@@ -548,11 +548,6 @@ class Typer extends Namer
548548
report.error(StableIdentPattern(tree, pt), tree.srcPos)
549549

550550
def typedSelect(tree: untpd.Select, pt: Type, qual: Tree)(using Context): Tree = qual match {
551-
case qual @ IntegratedTypeArgs(app) =>
552-
pt.revealIgnored match {
553-
case _: PolyProto => qual // keep the IntegratedTypeArgs to strip at next typedTypeApply
554-
case _ => app
555-
}
556551
case qual: ExtMethodApply =>
557552
qual.app
558553
case qual =>
@@ -3638,10 +3633,7 @@ class Typer extends Namer
36383633
if tree.symbol.isAllOf(ApplyProxyFlags) then newExpr
36393634
else adaptToArgs(wtp, pt)
36403635
case pt: PolyProto =>
3641-
tree match {
3642-
case _: IntegratedTypeArgs => tree
3643-
case _ => tryInsertApplyOrImplicit(tree, pt, locked)(tree) // error will be reported in typedTypeApply
3644-
}
3636+
tryInsertApplyOrImplicit(tree, pt, locked)(tree) // error will be reported in typedTypeApply
36453637
case pt: SelectionProto if tree.isInstanceOf[ExtMethodApply] =>
36463638
tree
36473639
case _ =>

0 commit comments

Comments
 (0)