Skip to content

Commit c2a1738

Browse files
committed
Bring back rewrite matches
Undoes: - Drop TransparentTyper (reverted from commit f6c440f)
1 parent 6ad2ac1 commit c2a1738

File tree

5 files changed

+378
-23
lines changed

5 files changed

+378
-23
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,11 @@ class Definitions {
338338
def NullType: TypeRef = NullClass.typeRef
339339
lazy val RuntimeNullModuleRef: TermRef = ctx.requiredModuleRef("scala.runtime.Null")
340340

341+
lazy val ImplicitScrutineeTypeSym =
342+
newSymbol(ScalaPackageClass, tpnme.IMPLICITkw, EmptyFlags, TypeBounds.empty).entered
343+
def ImplicitScrutineeTypeRef: TypeRef = ImplicitScrutineeTypeSym.typeRef
344+
345+
341346
lazy val ScalaPredefModuleRef: TermRef = ctx.requiredModuleRef("scala.Predef")
342347
def ScalaPredefModule(implicit ctx: Context): Symbol = ScalaPredefModuleRef.symbol
343348

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ object Applications {
6161
def productSelectorTypes(tp: Type, errorPos: Position = NoPosition)(implicit ctx: Context): List[Type] = {
6262
def tupleSelectors(n: Int, tp: Type): List[Type] = {
6363
val sel = extractorMemberType(tp, nme.selectorName(n), errorPos)
64-
// extractorMemberType will return NoType if this is the tail of tuple with an unknown tail
64+
// extractorMemberType will return NoType if this is the tail of tuple with an unknown tail
6565
// such as `Int *: T` where `T <: Tuple`.
6666
if (sel.exists) sel :: tupleSelectors(n + 1, tp) else Nil
6767
}
@@ -981,8 +981,13 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
981981
else trySelectUnapply(qual1)(_ => notAnExtractor(sel))
982982
}
983983

984+
/* Can probably be dropped. The idea is that inline unapply methods are available
985+
* for inspection in the Inliner's reduceMatch method, but are never inlined
986+
* when called from normal code.
987+
984988
if (unapplyFn.symbol.isInlineMethod)
985989
checkInInlineContext("implementation restriction: call to inline unapply", tree.pos)
990+
*/
986991

987992
/** Add a `Bind` node for each `bound` symbol in a type application `unapp` */
988993
def addBinders(unapp: Tree, bound: List[Symbol]) = unapp match {

0 commit comments

Comments
 (0)