diff --git a/1 b/1 new file mode 100644 index 000000000000..933da5caea62 --- /dev/null +++ b/1 @@ -0,0 +1,37270 @@ +result of ./src/dotty/tools/dotc/transform/Erasure.scala after frontend: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + import dotty.tools.dotc.core.Phases._ + import dotty.tools.dotc.core.DenotTransformers._ + import dotty.tools.dotc.core.Denotations._ + import dotty.tools.dotc.core.SymDenotations._ + import dotty.tools.dotc.core.Symbols._ + import dotty.tools.dotc.core.Contexts._ + import dotty.tools.dotc.core.Types._ + import dotty.tools.dotc.core.Names._ + import dotty.tools.dotc.core.StdNames._ + import dotty.tools.dotc.core.NameOps._ + import dotty.tools.dotc.core.Decorators._ + import dotty.tools.dotc.core.Constants._ + import dotty.tools.dotc.typer.NoChecking + import dotty.tools.dotc.typer.ProtoTypes._ + import dotty.tools.dotc.typer.ErrorReporting._ + import dotty.tools.dotc.core.TypeErasure._ + import dotty.tools.dotc.core.Decorators._ + import dotty.tools.dotc.ast.{Trees, tpd, untpd} + import dotty.tools.dotc.ast.Trees._ + import scala.collection.mutable.ListBuffer + import dotty.tools.dotc.core.Flags + import dotty.tools.dotc.transform.ValueClasses._ + import dotty.tools.dotc.transform.TypeUtils._ + import dotty.tools.dotc.transform.ExplicitOuter._ + import dotty.tools.dotc.typer.Mode + class Erasure() extends dotty.tools.dotc.util.DotClass() with + dotty.tools.dotc + .core.Phases.Phase with dotty.tools.dotc.core.DenotTransformers. + DenotTransformer + { thisTransformer: dotty.tools.dotc.transform.Erasure => + override def phaseName: String = "erasure" + override def runsAfter: + Set[Class[_ >: Nothing <: dotty.tools.dotc.core.Phases.Phase]] + = + Set.apply[Class[_ <: dotty.tools.dotc.core.Phases.Phase]']( + [classOf[dotty.tools.dotc.transform.InterceptedMethods], + classOf[dotty.tools.dotc.transform.Splitter] + ,classOf[dotty.tools.dotc.transform.ElimRepeated]]: + Class[_ + >: + dotty.tools.dotc.transform.InterceptedMethods & + dotty.tools.dotc.transform.Splitter + & dotty.tools.dotc.transform.ElimRepeated + <: + dotty.tools.dotc.transform.InterceptedMethods | + dotty.tools.dotc.transform.Splitter + | dotty.tools.dotc.transform.ElimRepeated + ]* + ) + def transform(ref: dotty.tools.dotc.core.Denotations.SingleDenotation)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Denotations.SingleDenotation = + ref match { + case ref @ _: dotty.tools.dotc.core.SymDenotations.SymDenotation => + assert(ctx.phase.==(this), + StringContext.apply(["transforming "," at ",""]: String*).s( + [ref,{ + ctx.phase + }]: + (dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + )* + ) + ) + if + ref.symbol.eq(dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass) + then { + private[this] val $1$: + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = + ref.info(ctx): dotty.tools.dotc.core.Types.Type @unchecked + match + { + case + dotty.tools.dotc.core.Types.ClassInfo(pre @ _, _, ps @ _, + decls @ _ + , selfInfo @ _): dotty.tools.dotc.core.Types.ClassInfo + => + Tuple4.apply[dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ]' + , dotty.tools.dotc.core.Scopes.Scope', + dotty.tools.dotc.util.DotClass' + ](pre, ps, decls, selfInfo) + } + val pre: dotty.tools.dotc.core.Types.Type = $1$._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = $1$._2 + val decls: dotty.tools.dotc.core.Scopes.Scope = $1$._3 + val selfInfo: dotty.tools.dotc.util.DotClass = $1$._4 + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + )(ctx).classInfo(ctx).decls.foreach[ + dotty.tools.dotc.core.Symbols.Symbol' + ]({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol' + = + extendedScope.enter[dotty.tools.dotc.core.Symbols.Symbol'](sym + ) + (ctx) + closure($anonfun) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$2 + val name$1: dotty.tools.dotc.core.Names.Name @uncheckedVariance + = + ref.copySymDenotation$default$3 + val initFlags$1: + dotty.tools.dotc.core.Flags.FlagSet @uncheckedVariance + = ref.copySymDenotation$default$4 + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + , ps, extendedScope, selfInfo)(ctx) + )(ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$6 + val annotations$1: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Annotations.Annotation + ] @uncheckedVariance + = ref.copySymDenotation$default$7 + ref.copySymDenotation(symbol$1, owner$1, name$1, initFlags$1, + info$1 + , privateWithin$1, annotations$1) + }(ctx) + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = ref.owner + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if oldOwner.eq(dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass else + oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + oldInfo + )(ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~(dotty.tools.dotc.core.Flags.HasDefaultParams) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass)(ctx).unary_! + , + StringContext.apply( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""]: String* + ).s( + [ref,{ + ctx.phase + },oldOwner,newOwner,oldInfo,newInfo,{ + oldOwner.eq(newOwner) + },{ + oldInfo.eq(newInfo) + }]: + ( + dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + | dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + | Boolean)* + ) + ) + { + val symbol$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = newOwner + val name$2: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, initFlags$2, + info$2 + , ref.copySymDenotation$default$6, + ref.copySymDenotation$default$7 + ) + }(ctx) + } + } + case ref @ _ => + ref.derivedSingleDenotation(ref.symbol, + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx))(ctx) + )(ctx) + } + val eraser: dotty.tools.dotc.transform.Erasure.Typer = + new dotty.tools.dotc.transform.Erasure.Typer() + def run(implicit ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit + unit.tpdTree_=( + Erasure.this.eraser.typedExpr(unit.tpdTree, + Erasure.this.eraser.typedExpr$default$2 + )(ctx.fresh.setPhase(this.next)) + ) + } + override def checkPostCondition(tree: dotty.tools.dotc.ast.tpd.Tree)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree)(ctx) + tree match { + case res @ _: dotty.tools.dotc.ast.tpd.This => + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + , res)(ctx).unary_! + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["Reference to "," from ",""]: String*) + ).i( + [res,{ + ctx.owner.showLocated(ctx) + }]: (dotty.tools.dotc.ast.tpd.This | String)* + )(ctx) + ) + case _ => + () + } + } + def assertErased(tree: dotty.tools.dotc.ast.tpd.Tree)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt, tree)(ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure. + apply + (tree.symbol(ctx)).unary_! + then Erasure.this.assertErased(tree.typeOpt.widen(ctx), tree)(ctx) + else + () + if ctx.mode.isExpr then + tree.tpe match { + case ref @ _: dotty.tools.dotc.core.Types.TermRef => + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["non-sym type "," of class "," with denot of class "," of " + , + ""]: String* + ) + ).i( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree]: + (dotty.tools.dotc.core.Types.TermRef | Class | + dotty.tools.dotc.ast.tpd.Tree + )* + )(ctx) + ) + case _ => + () + } + else () + } + def assertErased(tp: dotty.tools.dotc.core.Types.Type, + tree: dotty.tools.dotc.ast.tpd.Tree + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp)(ctx), + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""]: String* + ) + ).i( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe + },{ + tree.getClass() + },{ + ctx.phase + }]: + ( + dotty.tools.dotc.core.Types.Type | String | Class | + dotty.tools.dotc.ast.tpd.Tree + | dotty.tools.dotc.core.Phases.Phase)* + )(ctx) + ) + def assertErased$default$2: dotty.tools.dotc.ast.tpd.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree + } + final lazy module val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + final module class Erasure$() extends Object() with + dotty.tools.dotc.transform + .TypeTestsCasts { this: dotty.tools.dotc.transform.Erasure.type => + import dotty.tools.dotc.ast.tpd._ + final lazy module val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ + = + new dotty.tools.dotc.transform.Erasure.Boxing$() + final module class Boxing$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Boxing.type => + + def isUnbox(sym: dotty.tools.dotc.core.Symbols.Symbol)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.unbox).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def isBox(sym: dotty.tools.dotc.core.Symbols.Symbol)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.box).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def boxMethod(cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.box)(ctx). + symbol + def unboxMethod(cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.unbox)(ctx) + . + symbol + private def safelyRemovableUnboxArg(tree: dotty.tools.dotc.ast.tpd.Tree) + ( + implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + tree match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fn @ _, + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](arg @ _, scala.package.Nil): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + if + dotty.tools.dotc.transform.Erasure.Boxing.isUnbox(fn.symbol(ctx))( + ctx + ).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses. + contains + (arg.tpe.widen(ctx).typeSymbol(ctx)) + ) + => + arg + case _ => + dotty.tools.dotc.ast.tpd.EmptyTree + } + def constant(tree: dotty.tools.dotc.ast.tpd.Tree, + const: dotty.tools.dotc.ast.tpd.Tree + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree)(ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.tpd.Tree = tree + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($2$) + }, const)(ctx) + final def box(tree: dotty.tools.dotc.ast.tpd.Tree, + target: ByNameTypeTree(Ident(String)) + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["boxing ",": "," into ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },target]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, _) + : + dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx).typeRef + ( + ctx) + , { + val $3$: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + (dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx))( + ctx + ) + )(ctx) + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($3$) + })(ctx) + case tp @ _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).BoxedUnit_UNIT + )(ctx) + )(ctx) + else + if + cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).NothingClass) + then tree else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + val arg: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree)(ctx) + if arg.isEmpty then + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.boxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + else { + ctx.log( + StringContext.apply( + ["boxing an unbox: "," -> ",""]: String* + ).s( + [{ + tree.symbol(ctx) + },{ + arg.tpe + }]: + (dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + )* + ) + ) + arg + } + } + } + }) + def box$default$2: String = "" + def unbox(tree: dotty.tools.dotc.ast.tpd.Tree, + pt: dotty.tools.dotc.core.Types.Type + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["unboxing ",": "," as a ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + pt match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, + underlying @ _ + ): dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + val tree1: dotty.tools.dotc.ast.tpd.Tree = + if + tree.tpe.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).NullClass + )(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + underlying + ).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, + underlying + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Select[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + tree + , + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + . + typeRef(ctx) + )(ctx) + ).select( + dotty.tools.dotc.transform.ValueClasses.valueClassUnbox( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + )(ctx) + )(ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree1, pt)(ctx) + case _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply(()) + )(ctx) + )(ctx) + else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.unboxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + } + } + }) + def cast(tree: dotty.tools.dotc.ast.tpd.Tree, + pt: dotty.tools.dotc.core.Types.Type + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass)(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt)(ctx) else + Tuple2.apply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ](tree.tpe, pt) match { + case + Tuple2.unapply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ]( + dotty.tools.dotc.core.Types.JavaArrayType(treeElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + , + dotty.tools.dotc.core.Types.JavaArrayType(ptElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + ) + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(ptElem) + . + isPrimitiveValueType(ctx).unary_! + ) + => + dotty.tools.dotc.transform.Erasure.Boxing.cast( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod( + dotty.tools.dotc.core.StdNames.nme.toObjectArray + ) + )(ctx) + ).appliedTo(tree)(ctx) + , pt)(ctx) + case _ => + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(pt). + isPrimitiveValueType + (ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree' + ](tree).asInstance(pt)(ctx) + } + } + def adaptToType(tree: dotty.tools.dotc.ast.tpd.Tree, + pt: dotty.tools.dotc.core.Types.Type + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(scala.package.Nil, _): + dotty.tools.dotc.core.Types.MethodType + if tree.isTerm => + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree' + ](tree).appliedToNone(ctx) + , pt)(ctx) + case tpw @ _ => + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType].||( + tree.tpe.<:<(pt)(ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(tpw). + isErasedValueType + (ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(pt) + . + isErasedValueType(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt + ) + (ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + tpw + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx).unary_! + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_! + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree + , + pt)(ctx) + , pt)(ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree, + pt + )(ctx) + } + } + class Typer() extends dotty.tools.dotc.typer.ReTyper() with + dotty.tools.dotc + .typer.NoChecking { + import dotty.tools.dotc.transform.Erasure.Boxing._ + def erasedType(tree: dotty.tools.dotc.ast.untpd.Tree)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.TermRef if tree.isTerm => + dotty.tools.dotc.core.TypeErasure.erasedRef(tp)(ctx) + case tp @ _ => + dotty.tools.dotc.core.TypeErasure.erasure(tp)(ctx) + } + override def promote(tree: dotty.tools.dotc.ast.untpd.Tree)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): tree.ThisTree[dotty.tools.dotc.core.Types.Type] = { + assert(tree.hasType) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree)(ctx) + ctx.log( + StringContext.apply(["promoting ",": ",""]: String*).s( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying(erased.showWithUnderlying$default$1)( + ctx + ) + }]: String* + ) + ) + tree.withType(erased)(ctx) + } + override def typedLiteral(tree: dotty.tools.dotc.ast.untpd.Literal)( + implicit ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Literal = + if + tree.typeOpt.isRef(dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass + ) + (ctc) + then tree.withType(tree.typeOpt)(ctc) else + super.typedLiteral(tree)(ctc) + override def typedSelect(tree: dotty.tools.dotc.ast.untpd.Select, + pt: dotty.tools.dotc.core.Types.Type + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).exists, + tree.show(ctx) + ) + def select(qual: dotty.tools.dotc.ast.tpd.Tree, + sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.tpd.Tree = { + val name: sym.ThisName = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.NamedType if + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tp.name).isInheritedName + => + dotty.tools.dotc.core.NameOps.NameDecorator[sym.ThisName']( + sym.name(ctx) + ).inheritedName + case _ => + sym.name(ctx) + } + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, sym.name(ctx))(ctx + ) + .withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym(qual.tpe, sym)( + ctx + ) + )(ctx) + } + def selectArrayMember(qual: dotty.tools.dotc.ast.tpd.Tree, + erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx) + then + Typer.this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tree.name).genericArrayOp + , pt, [qual]: dotty.tools.dotc.ast.tpd.Tree*)(ctx) + else + if qual.tpe.<:<(erasedPre)(ctx).unary_! then + selectArrayMember( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, erasedPre + ) + (ctx) + , erasedPre) + else + Typer.this.assignType( + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tree.name).primitiveArrayOp + )(ctx) + , qual)(ctx) + def adaptIfSuper(qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = + qual match { + case + dotty.tools.dotc.ast.Trees.Super.unapply[ + dotty.tools.dotc.core.Types.Type' + ](thisQual @ _, dotty.tools.dotc.core.StdNames.tpnme.EMPTY): + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + => + private[this] val $4$: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = + qual.tpe: dotty.tools.dotc.core.Types.Type @unchecked match { + case + dotty.tools.dotc.core.Types.SuperType(thisType @ _, + supType @ _ + ): dotty.tools.dotc.core.Types.SuperType + => + Tuple2.apply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ](thisType, supType) + } + val thisType: dotty.tools.dotc.core.Types.Type = $4$._1 + val supType: dotty.tools.dotc.core.Types.Type = $4$._2 + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).is(dotty.tools.dotc.core.Flags.Trait)(ctx) + then + dotty.tools.dotc.ast.tpd.cpy.Super(qual)(thisQual, + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner. + asClass + .name(ctx) + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + )(ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + thisType.firstParent(ctx) + )(ctx) + )(ctx) + case _ => + qual + } + def recur(qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe.widen(ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).isConstructor + , + StringContext.apply(["",""]: String*).s( + [{ + sym.showLocated(ctx) + }]: String* + ) + ) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx).info(ctx).decl(sym.name(ctx))(ctx).symbol + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe + ).isErasedValueType(ctx) + ) + then + recur( + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + ) + else + if qualIsPrimitive.unary_!.&&(symIsPrimitive) then + recur( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass + ) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier.typeOpt.widen(ctx).finalResultType + )(ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.tpd.Tree = + adaptIfSuper(qual) + if + qual1.tpe.derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.tpd.Super] + ) + then select(qual1, sym) else + recur( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx). + owner + )(ctx).typeRef(ctx) + )(ctx) + ) + } + } + recur( + Typer.this.typed(tree.qualifier, + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + )(ctx) + ) + } + override def typedSelectFromTypeTree( + tree: dotty.tools.dotc.ast.untpd.SelectFromTypeTree + , pt: dotty.tools.dotc.core.Types.Type)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name).withPos(tree.pos).withType + ( + Typer.this.erasedType(tree)(ctx))(ctx) + override def typedThis(tree: dotty.tools.dotc.ast.untpd.This)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx))(ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree)(ctx) else { + ctx.log( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["computing outer path from ","%, % to ",", encl class = ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + ownersIterator + (ctx).toList + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + }]: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Symbols.Symbol + ] + | dotty.tools.dotc.core.Symbols.Symbol)* + )(ctx) + ) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + private def runtimeCallWithProtoArgs( + name: dotty.tools.dotc.core.Names.Name + , pt: dotty.tools.dotc.core.Types.Type, + args: + scala.collection.Seq[dotty.tools.dotc.ast.tpd.Tree] @ + dotty.annotation.internal.Repeated + () + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.TermSymbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: + scala.collection.immutable.List[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Symbols.toDenot(meth)(ctx).info(ctx). + firstParamTypes + .drop(args.length) + val followingArgs: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + ' + ](Typer.this.protoArgs(pt)).zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](followingParams)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }).asInstanceOf[scala.package.List[dotty.tools.dotc.ast.tpd.Tree]] + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + )(ctx) + ).appliedToArgs( + args.toList.++[dotty.tools.dotc.ast.tpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ]' + ](followingArgs)( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ) + )(ctx) + } + private def protoArgs(pt: dotty.tools.dotc.core.Types.Type): + scala.package.List[dotty.tools.dotc.ast.untpd.Tree] + = + pt match { + case pt @ _: dotty.tools.dotc.typer.ProtoTypes.FunProto => + pt.args.++[dotty.tools.dotc.ast.untpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]' + ](Typer.this.protoArgs(pt.resultType))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + ) + case _ => + scala.package.Nil + } + override def typedTypeApply(tree: dotty.tools.dotc.ast.untpd.TypeApply, + pt: dotty.tools.dotc.core.Types.Type + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val ntree: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree.asInstanceOf[dotty.tools.dotc.ast.tpd.TypeApply] + )(ctx) + ntree match { + case + dotty.tools.dotc.ast.Trees.TypeApply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fun @ _, args @ _): + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + => + val fun1: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + )(ctx) + fun1.tpe.widen(ctx) match { + case funTpe @ _: dotty.tools.dotc.core.Types.PolyType => + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](args).mapconserve[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.typedType(_$1, Typer.this.typedType$default$2 + ) + (ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.TypeApply(tree)(fun1, args1)( + ctx + ).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd.ListOfTreeDecorator(args1).tpes + )(ctx) + )(ctx) + case _ => + fun1 + } + case _ => + Typer.this.typedExpr(ntree, pt)(ctx) + } + } + override def typedApply(tree: dotty.tools.dotc.ast.untpd.Apply, + pt: dotty.tools.dotc.core.Types.Type + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + private[this] val $5$: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = + tree: dotty.tools.dotc.ast.untpd.Apply @unchecked match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[Null'](fun @ _, + args @ _ + ) + => + Tuple2.apply[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ]' + ](fun, args) + } + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = $5$._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = $5$._2 + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply + ) + then Typer.this.typedUnadapted(args.head, pt)(ctx) else + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this)( + ctx + ) + )(ctx) match { + case fun1 @ _: dotty.tools.dotc.ast.tpd.Apply => + fun1 + case fun1 @ _ => + fun1.tpe.widen(ctx) match { + case mt @ _: dotty.tools.dotc.core.Types.MethodType => + val outers: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).args( + fun.asInstanceOf[dotty.tools.dotc.ast.tpd.Tree] + ) + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = + { + val $6$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = outers + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]( + args.++[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]' + ](Typer.this.protoArgs(pt))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ] + ).:::[dotty.tools.dotc.ast.Trees.Tree[Null]']($6$) + ) + }.zipWithConserve[dotty.tools.dotc.core.Types.Type']( + mt.paramTypes + )({ + def $anonfun(tree: dotty.tools.dotc.ast.Trees.Tree[Null] + , + pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[Null] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.Apply(tree)(fun1, args1)(ctx) + . + withType(mt.resultType)(ctx) + case _ => + throw + new MatchError( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["tree "," has unexpected type of function ", + ", was " + ,""]: String* + ) + ).i( + [tree,{ + fun1.tpe.widen(ctx) + },{ + fun.typeOpt.widen(ctx) + }]: + (dotty.tools.dotc.ast.untpd.Apply | + dotty.tools.dotc.core.Types.Type + )* + )(ctx) + ) + } + } + } + override def typedSeqLiteral(tree: dotty.tools.dotc.ast.untpd.SeqLiteral + , + pt: dotty.tools.dotc.core.Types.Type)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.SeqLiteral = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt)(ctx) + )(ctx) + override def typedValDef(vdef: dotty.tools.dotc.ast.untpd.ValDef, + sym: dotty.tools.dotc.core.Symbols.Symbol + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2)(ctx).withPos( + vdef.tpt.pos + ) + ) + val rhs$1: dotty.tools.dotc.ast.untpd.Tree = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy.ValDef(vdef)(name$3, tpt$1, rhs$1) + }, sym)(ctx) + override def typedDefDef(ddef: dotty.tools.dotc.ast.untpd.DefDef, + sym: dotty.tools.dotc.core.Symbols.Symbol + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef[dotty.tools.dotc.core.Types.Type] + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx).resultType + val ddef1: dotty.tools.dotc.ast.untpd.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.DefDef$default$2(ddef) + val vparamss$1: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + ] + = { + val $7$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = + ddef.vparamss.flatten[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ] + ) + scala.package.Nil.::[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ]($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2 + )(ctx).withPos(ddef.tpt.pos) + ) + val rhs$2: + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + = + ddef.rhs match { + case + id @ + dotty.tools.dotc.ast.Trees.Ident.unapply[ + dotty.tools.dotc.ast.Trees.Untyped' + ](dotty.tools.dotc.core.StdNames.nme.WILDCARD): + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + => + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe)(ctx) + ) + case _ => + ddef.rhs + } + dotty.tools.dotc.ast.untpd.cpy.DefDef(ddef)(name$4, + scala.package.Nil + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym)(ctx) + } + override def typedTypeDef(tdef: dotty.tools.dotc.ast.untpd.TypeDef, + sym: dotty.tools.dotc.core.Symbols.Symbol + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree + override def typedStats( + stats: scala.package.List[dotty.tools.dotc.ast.untpd.Tree] + , exprOwner: dotty.tools.dotc.core.Symbols.Symbol)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): scala.package.List[dotty.tools.dotc.ast.tpd.Tree] = { + val stats1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + ] + = + dotty.tools.dotc.ast.Trees.flatten[dotty.tools.dotc.core.Types.Type' + ] + (super.typedStats(stats, exprOwner)(ctx)) + if ctx.owner.isClass then { + val $8$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ] + = stats1 + Typer.this.addBridges(stats, stats1)(ctx).:::[ + dotty.tools.dotc.ast.tpd.Tree' + ]($8$) + } else stats1 + } + def addBridges( + oldStats: scala.package.List[dotty.tools.dotc.ast.untpd.Tree] + , newStats: scala.package.List[dotty.tools.dotc.ast.tpd.Tree])( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): scala.package.List[dotty.tools.dotc.ast.tpd.Tree] = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase + ) + def traverse(after: scala.package.List[dotty.tools.dotc.ast.tpd.Tree] + , + before: scala.package.List[dotty.tools.dotc.ast.untpd.Tree], + emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.package.List[dotty.tools.dotc.ast.tpd.DefDef] = { + after match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](member @ _: dotty.tools.dotc.ast.tpd.DefDef, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + => + before match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ](oldMember @ _: dotty.tools.dotc.ast.untpd.DefDef, + oldTail @ _ + ): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + => + val oldSymbol: dotty.tools.dotc.core.Symbols.Symbol = + oldMember.symbol(beforeCtx) + val newSymbol: dotty.tools.dotc.core.Symbols.Symbol = + member.symbol(ctx) + assert(oldSymbol.name(beforeCtx).==(newSymbol.name(ctx)), + StringContext.apply([""," bridging with ",""]: String*).s( + [{ + oldSymbol.name(beforeCtx) + },{ + newSymbol.name(ctx) + }]: (oldSymbol.ThisName | newSymbol.ThisName)* + ) + ) + val newOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldSymbol.denot(ctx).allOverriddenSymbols(ctx).toSet[ + dotty.tools.dotc.core.Symbols.Symbol' + ] + val oldOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + dotty.tools.dotc.core.Symbols.toDenot(newSymbol)(ctx). + allOverriddenSymbols + (beforeCtx).toSet[dotty.tools.dotc.core.Symbols.Symbol'] + def stillInBaseClass( + sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + derivesFrom + (dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner)( + ctx + ) + val neededBridges: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldOverridden.--(newOverridden).filter({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol) + : + Boolean = stillInBaseClass(sym) + closure($anonfun) + }) + var minimalSet: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + Set.apply[dotty.tools.dotc.core.Symbols.Symbol]( + []: Nothing* + ) + neededBridges.foreach[Unit']({ + def $anonfun(bridge: dotty.tools.dotc.core.Symbols.Symbol) + : + Unit' = { + val isRequired: Boolean = + minimalSet.forall({ + def $anonfun( + nxtBridge: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx) + . + info(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot(nxtBridge) + ( + ctx).info(ctx) + )(ctx).unary_! + closure($anonfun) + }) + if isRequired then { + val clash: + Option[dotty.tools.dotc.core.Symbols.Symbol] + = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(oldSymbol)( + ctx + ).owner + )(ctx).decls(ctx).lookupAll(bridge.name(ctx))(ctx). + find + ({ + { + def $anonfun( + sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = { + sym.name(ctx).eq(bridge.name(ctx)).&&( + dotty.tools.dotc.core.Symbols.toDenot(sym)( + ctx + ).info(ctx).widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + } + closure($anonfun) + } + }).orElse[dotty.tools.dotc.core.Symbols.Symbol']( + emittedBridges.find({ + def $anonfun( + stat: dotty.tools.dotc.ast.tpd.DefDef + ): Boolean = + stat.name.==(bridge.name(ctx)).&&( + stat.tpe.widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + closure($anonfun) + }).map[dotty.tools.dotc.core.Symbols.Symbol']({ + def $anonfun( + _$2: dotty.tools.dotc.ast.tpd.DefDef + ): dotty.tools.dotc.core.Symbols.Symbol' = + _$2.symbol(ctx) + closure($anonfun) + }) + ) + clash match { + case + Some.unapply[dotty.tools.dotc.core.Symbols.Symbol' + ] + (cl @ _): + Some[dotty.tools.dotc.core.Symbols.Symbol'] + => + ctx.error( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["bridge for method "," of type ","\\n"]: + String* + ) + ).i( + [{ + newSymbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + newSymbol + )(ctx).info(beforeCtx) + }]: + (String | dotty.tools.dotc.core.Types.Type)* + )(ctx).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["clashes with "," of type ","\\n"]: + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(cl)( + ctx + ).symbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(cl + ) + (ctx).symbol + )(ctx).info(beforeCtx) + }]: + (String | dotty.tools.dotc.core.Types.Type + ) + * + )(ctx) + ).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["both have same type after erasure: ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).symbol + )(ctx).info(ctx) + }]: dotty.tools.dotc.core.Types.Type* + )(ctx) + ) + , ctx.error$default$2) + case None => + minimalSet = minimalSet.+(bridge) + } + } else () + } + closure($anonfun) + }) + val bridgeImplementations: + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + minimalSet.map[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + { + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol + ) + : + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + = { + Typer.this.makeBridgeDef(member, sym)(ctx) + } + closure($anonfun) + } + })( + scala.collection.immutable.Set.canBuildFrom[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + emittedBridges.++=(bridgeImplementations) + traverse(newTail, oldTail, traverse$default$3) + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ](notADefDef @ _, oldTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + => + traverse(after, oldTail, traverse$default$3) + } + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](notADefDef @ _, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + => + traverse(newTail, before, traverse$default$3) + } + } + def traverse$default$3: + scala.collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + = + collection.mutable.ListBuffer.apply[dotty.tools.dotc.ast.tpd.DefDef] + ( + []: Nothing*) + traverse(newStats, oldStats, traverse$default$3) + } + def makeBridgeDef(newDef: dotty.tools.dotc.ast.tpd.DefDef, + parentSym: dotty.tools.dotc.core.Symbols.Symbol + )(implicit ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.DefDef + = { + def error(reason: String): Nothing = { + assert(false, + StringContext.apply( + ["failure creating bridge from "," to ",", reason: ",""]: + String* + ).s( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason]: (dotty.tools.dotc.core.Symbols.Symbol | String)* + ) + ) + ??? + } + val bridge: dotty.tools.dotc.core.Symbols.TermSymbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + val name$5: parentSym.ThisName = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ctx.newSymbol$default$5[parentSym.ThisName'] + ctx.newSymbol[parentSym.ThisName'](owner$3, name$5, flags$1, + info$3 + , privateWithin$2, + coord = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx) + . + owner.coord + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase.prev.asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + )(ctx) + ctx.debuglog( + StringContext.apply(["generating bridge from "," to ",""]: String*). + s + ( + [{ + newDef.symbol(ctx) + },bridge]: dotty.tools.dotc.core.Symbols.Symbol* + ) + ) + val sel: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.This[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .asClass + )(ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + termRef + (ctx) + )(ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx).info(ctx).widen( + ctx + ).resultType + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun( + paramss: + scala.package.List[ + scala.package.List[dotty.tools.dotc.ast.tpd.Tree] + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val rhs: dotty.tools.dotc.ast.tpd.Tree = + paramss.foldLeft[dotty.tools.dotc.ast.tpd.Tree'](sel)({ + def $anonfun(fun: dotty.tools.dotc.ast.tpd.Tree, + vparams: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ): dotty.tools.dotc.ast.tpd.Tree = + fun.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(names @ _, + types @ _ + ): dotty.tools.dotc.core.Types.MethodType + => + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + Tuple2.apply[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ](vparams, types) + ).zipped[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + ] + , + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ).map[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + def $anonfun( + _$3: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , _$4: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd.EmptyTree + )(ctx) + closure($anonfun) + })( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + )(ctx) + case a @ _ => + error( + StringContext.apply( + ["can not resolve apply type ",""]: String* + ).s([a]: dotty.tools.dotc.core.Types.Type*) + ) + } + closure($anonfun) + }) + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3)( + ctx + ) + } + closure($anonfun) + } + })(ctx) + } + override def adapt(tree: dotty.tools.dotc.ast.tpd.Tree, + pt: dotty.tools.dotc.core.Types.Type + , original: dotty.tools.dotc.ast.untpd.Tree)( + implicit ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + { + val printer$1: + dotty.tools.dotc.config.Printers.Printer @uncheckedVariance + = + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["adapting ",": "," to ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , printer$1, show = true) + }({ + assert( + ctx.phase.==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase. + next + ) + , ctx.phase) + if tree.isEmpty then tree else + if ctx.mode.is(dotty.tools.dotc.typer.Mode.Pattern) then tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt)( + ctx + ) + }) + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after TreeTransform:{firstTransform, synthetics}: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure() extends dotty.tools.dotc.util.DotClass() with + dotty.tools.dotc + .core.Phases.Phase with dotty.tools.dotc.core.DenotTransformers. + DenotTransformer + { thisTransformer: dotty.tools.dotc.transform.Erasure => + def phaseName: String = "erasure" + def runsAfter: + scala.collection.immutable.Set[ + Class[_ <: dotty.tools.dotc.core.Phases.Phase] + ] + = + Set.apply[Class[_ <: dotty.tools.dotc.core.Phases.Phase]']( + [classOf[dotty.tools.dotc.transform.InterceptedMethods], + classOf[dotty.tools.dotc.transform.Splitter] + ,classOf[dotty.tools.dotc.transform.ElimRepeated]]: + Class[_ + >: + dotty.tools.dotc.transform.InterceptedMethods & + dotty.tools.dotc.transform.Splitter + & dotty.tools.dotc.transform.ElimRepeated + <: + dotty.tools.dotc.transform.InterceptedMethods | + dotty.tools.dotc.transform.Splitter + | dotty.tools.dotc.transform.ElimRepeated + ]* + ) + def transform(val ref: dotty.tools.dotc.core.Denotations.SingleDenotation) + ( + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Denotations.SingleDenotation + = + ref match { + case ref @ _: dotty.tools.dotc.core.SymDenotations.SymDenotation => + assert(ctx.phase.==(this), + StringContext.apply(["transforming "," at ",""]: String*).s( + [ref,{ + ctx.phase + }]: + (dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + )* + ) + ) + if + ref.symbol.eq(dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass) + then { + val $1$: + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = + ref.info(ctx): dotty.tools.dotc.core.Types.Type @unchecked + match + { + case + dotty.tools.dotc.core.Types.ClassInfo(pre @ _, _, ps @ _, + decls @ _ + , selfInfo @ _): dotty.tools.dotc.core.Types.ClassInfo + => + Tuple4.apply[dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ]' + , dotty.tools.dotc.core.Scopes.Scope', + dotty.tools.dotc.util.DotClass' + ](pre, ps, decls, selfInfo) + } + val pre: dotty.tools.dotc.core.Types.Type = $1$._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = $1$._2 + val decls: dotty.tools.dotc.core.Scopes.Scope = $1$._3 + val selfInfo: dotty.tools.dotc.util.DotClass = $1$._4 + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + )(ctx).classInfo(ctx).decls.foreach[ + dotty.tools.dotc.core.Symbols.Symbol' + ]({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol' + = + extendedScope.enter[dotty.tools.dotc.core.Symbols.Symbol'](sym + ) + (ctx) + closure($anonfun) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$2 + val name$1: dotty.tools.dotc.core.Names.Name @uncheckedVariance + = + ref.copySymDenotation$default$3 + val initFlags$1: + dotty.tools.dotc.core.Flags.FlagSet @uncheckedVariance + = ref.copySymDenotation$default$4 + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + , ps, extendedScope, selfInfo)(ctx) + )(ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$6 + val annotations$1: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Annotations.Annotation + ] @uncheckedVariance + = ref.copySymDenotation$default$7 + ref.copySymDenotation(symbol$1, owner$1, name$1, initFlags$1, + info$1 + , privateWithin$1, annotations$1) + }(ctx) + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = ref.owner + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if oldOwner.eq(dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass else + oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + oldInfo + )(ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~(dotty.tools.dotc.core.Flags.HasDefaultParams) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass)(ctx).unary_! + , + StringContext.apply( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""]: String* + ).s( + [ref,{ + ctx.phase + },oldOwner,newOwner,oldInfo,newInfo,{ + oldOwner.eq(newOwner) + },{ + oldInfo.eq(newInfo) + }]: + ( + dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + | dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + | Boolean)* + ) + ) + { + val symbol$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = newOwner + val name$2: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, initFlags$2, + info$2 + , ref.copySymDenotation$default$6, + ref.copySymDenotation$default$7 + ) + }(ctx) + } + } + case ref @ _ => + ref.derivedSingleDenotation(ref.symbol, + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx))(ctx) + )(ctx) + } + val eraser: dotty.tools.dotc.transform.Erasure.Typer = + new dotty.tools.dotc.transform.Erasure.Typer() + def run(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit + unit.tpdTree_=( + Erasure.this.eraser.typedExpr(unit.tpdTree, + Erasure.this.eraser.typedExpr$default$2 + )(ctx.fresh.setPhase(this.next)) + ) + } + def checkPostCondition(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree)(ctx) + tree match { + case res @ _: dotty.tools.dotc.ast.tpd.This => + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + , res)(ctx).unary_! + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["Reference to "," from ",""]: String*) + ).i( + [res,{ + ctx.owner.showLocated(ctx) + }]: (dotty.tools.dotc.ast.tpd.This | String)* + )(ctx) + ) + case _ => + () + } + } + def assertErased(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt, tree)(ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure. + apply + (tree.symbol(ctx)).unary_! + then Erasure.this.assertErased(tree.typeOpt.widen(ctx), tree)(ctx) + else + () + if ctx.mode.isExpr then + tree.tpe match { + case ref @ _: dotty.tools.dotc.core.Types.TermRef => + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["non-sym type "," of class "," with denot of class "," of " + , + ""]: String* + ) + ).i( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree]: + (dotty.tools.dotc.core.Types.TermRef | Class | + dotty.tools.dotc.ast.tpd.Tree + )* + )(ctx) + ) + case _ => + () + } + else () + } + def assertErased(val tp: dotty.tools.dotc.core.Types.Type, + val tree: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp)(ctx), + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""]: String* + ) + ).i( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe + },{ + tree.getClass() + },{ + ctx.phase + }]: + ( + dotty.tools.dotc.core.Types.Type | String | Class | + dotty.tools.dotc.ast.tpd.Tree + | dotty.tools.dotc.core.Phases.Phase)* + )(ctx) + ) + def assertErased$default$2: dotty.tools.dotc.ast.tpd.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$() extends Object() with dotty.tools.dotc.transform. + TypeTestsCasts + { this: dotty.tools.dotc.transform.Erasure$.type => + val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ = + new dotty.tools.dotc.transform.Erasure.Boxing$() + class Boxing$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Boxing$.type => + + def isUnbox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.unbox).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def isBox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.box).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def boxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.box)(ctx). + symbol + def unboxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.unbox)(ctx) + . + symbol + def safelyRemovableUnboxArg(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + tree match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fn @ _, + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](arg @ _, scala.package.Nil): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + if + dotty.tools.dotc.transform.Erasure.Boxing.isUnbox(fn.symbol(ctx))( + ctx + ).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses. + contains + (arg.tpe.widen(ctx).typeSymbol(ctx)) + ) + => + arg + case _ => + dotty.tools.dotc.ast.tpd.EmptyTree + } + def constant(val tree: dotty.tools.dotc.ast.tpd.Tree, + val const: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree)(ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.tpd.Tree = tree + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($2$) + }, const)(ctx) + def box(val tree: dotty.tools.dotc.ast.tpd.Tree, val target: => String)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["boxing ",": "," into ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },target]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, _) + : + dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx).typeRef + ( + ctx) + , { + val $3$: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + (dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx))( + ctx + ) + )(ctx) + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($3$) + })(ctx) + case tp @ _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).BoxedUnit_UNIT + )(ctx) + )(ctx) + else + if + cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).NothingClass) + then tree else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + val arg: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree)(ctx) + if arg.isEmpty then + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.boxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + else { + ctx.log( + StringContext.apply( + ["boxing an unbox: "," -> ",""]: String* + ).s( + [{ + tree.symbol(ctx) + },{ + arg.tpe + }]: + (dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + )* + ) + ) + arg + } + } + } + }) + def box$default$2: String = "" + def unbox(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["unboxing ",": "," as a ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + pt match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, + underlying @ _ + ): dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + val tree1: dotty.tools.dotc.ast.tpd.Tree = + if + tree.tpe.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).NullClass + )(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + underlying + ).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, + underlying + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Select[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + tree + , + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + . + typeRef(ctx) + )(ctx) + ).select( + dotty.tools.dotc.transform.ValueClasses.valueClassUnbox( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + )(ctx) + )(ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree1, pt)(ctx) + case _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply(()) + )(ctx) + )(ctx) + else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.unboxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + } + } + }) + def cast(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass)(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt)(ctx) else + Tuple2.apply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ](tree.tpe, pt) match { + case + Tuple2.unapply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ]( + dotty.tools.dotc.core.Types.JavaArrayType(treeElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + , + dotty.tools.dotc.core.Types.JavaArrayType(ptElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + ) + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(ptElem) + . + isPrimitiveValueType(ctx).unary_! + ) + => + dotty.tools.dotc.transform.Erasure.Boxing.cast( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod( + dotty.tools.dotc.core.StdNames.nme.toObjectArray + ) + )(ctx) + ).appliedTo(tree)(ctx) + , pt)(ctx) + case _ => + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(pt). + isPrimitiveValueType + (ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree' + ](tree).asInstance(pt)(ctx) + } + } + def adaptToType(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(scala.package.Nil, _): + dotty.tools.dotc.core.Types.MethodType + if tree.isTerm => + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree' + ](tree).appliedToNone(ctx) + , pt)(ctx) + case tpw @ _ => + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType].||( + tree.tpe.<:<(pt)(ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(tpw). + isErasedValueType + (ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(pt) + . + isErasedValueType(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt + ) + (ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + tpw + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx).unary_! + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_! + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree + , + pt)(ctx) + , pt)(ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree, + pt + )(ctx) + } + } + class Typer() extends dotty.tools.dotc.typer.ReTyper() with + dotty.tools.dotc + .typer.NoChecking { + def erasedType(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.TermRef if tree.isTerm => + dotty.tools.dotc.core.TypeErasure.erasedRef(tp)(ctx) + case tp @ _ => + dotty.tools.dotc.core.TypeErasure.erasure(tp)(ctx) + } + def promote(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): tree.ThisTree[dotty.tools.dotc.core.Types.Type]#Apply = { + assert(tree.hasType) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree)(ctx) + ctx.log( + StringContext.apply(["promoting ",": ",""]: String*).s( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying(erased.showWithUnderlying$default$1)( + ctx + ) + }]: String* + ) + ) + tree.withType(erased)(ctx) + } + def typedLiteral(val tree: dotty.tools.dotc.ast.untpd.Literal)( + val ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Literal = + if + tree.typeOpt.isRef(dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass + ) + (ctc) + then tree.withType(tree.typeOpt)(ctc) else + super.typedLiteral(tree)(ctc) + def typedSelect(val tree: dotty.tools.dotc.ast.untpd.Select, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).exists, + tree.show(ctx) + ) + def select(val qual: dotty.tools.dotc.ast.tpd.Tree, + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.tpd.Tree = { + val name: sym.ThisName = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.NamedType if + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tp.name).isInheritedName + => + dotty.tools.dotc.core.NameOps.NameDecorator[sym.ThisName']( + sym.name(ctx) + ).inheritedName + case _ => + sym.name(ctx) + } + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, sym.name(ctx))(ctx + ) + .withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym(qual.tpe, sym)( + ctx + ) + )(ctx) + } + def selectArrayMember(val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx) + then + Typer.this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tree.name).genericArrayOp + , pt, [qual]: dotty.tools.dotc.ast.tpd.Tree*)(ctx) + else + if qual.tpe.<:<(erasedPre)(ctx).unary_! then + selectArrayMember( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, erasedPre + ) + (ctx) + , erasedPre) + else + Typer.this.assignType( + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tree.name).primitiveArrayOp + )(ctx) + , qual)(ctx) + def adaptIfSuper(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = + qual match { + case + dotty.tools.dotc.ast.Trees.Super.unapply[ + dotty.tools.dotc.core.Types.Type' + ](thisQual @ _, dotty.tools.dotc.core.StdNames.tpnme.EMPTY): + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + => + val $4$: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = + qual.tpe: dotty.tools.dotc.core.Types.Type @unchecked match { + case + dotty.tools.dotc.core.Types.SuperType(thisType @ _, + supType @ _ + ): dotty.tools.dotc.core.Types.SuperType + => + Tuple2.apply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ](thisType, supType) + } + val thisType: dotty.tools.dotc.core.Types.Type = $4$._1 + val supType: dotty.tools.dotc.core.Types.Type = $4$._2 + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).is(dotty.tools.dotc.core.Flags.Trait)(ctx) + then + dotty.tools.dotc.ast.tpd.cpy.Super(qual)(thisQual, + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner. + asClass + .name(ctx) + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + )(ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + thisType.firstParent(ctx) + )(ctx) + )(ctx) + case _ => + qual + } + def recur(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe.widen(ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).isConstructor + , + StringContext.apply(["",""]: String*).s( + [{ + sym.showLocated(ctx) + }]: String* + ) + ) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx).info(ctx).decl(sym.name(ctx))(ctx).symbol + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe + ).isErasedValueType(ctx) + ) + then + recur( + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + ) + else + if qualIsPrimitive.unary_!.&&(symIsPrimitive) then + recur( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass + ) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier.typeOpt.widen(ctx).finalResultType + )(ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.tpd.Tree = + adaptIfSuper(qual) + if + qual1.tpe.derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.tpd.Super] + ) + then select(qual1, sym) else + recur( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx). + owner + )(ctx).typeRef(ctx) + )(ctx) + ) + } + } + recur( + Typer.this.typed(tree.qualifier, + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + )(ctx) + ) + } + def typedSelectFromTypeTree( + val tree: dotty.tools.dotc.ast.untpd.SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.Type)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name).withPos(tree.pos).withType + ( + Typer.this.erasedType(tree)(ctx))(ctx) + def typedThis(val tree: dotty.tools.dotc.ast.untpd.This)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx))(ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree)(ctx) else { + ctx.log( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["computing outer path from ","%, % to ",", encl class = ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + ownersIterator + (ctx).toList + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + }]: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Symbols.Symbol + ] + | dotty.tools.dotc.core.Symbols.Symbol)* + )(ctx) + ) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs(val name: dotty.tools.dotc.core.Names.Name + , + val pt: dotty.tools.dotc.core.Types.Type, + val args: + scala.collection.Seq[dotty.tools.dotc.ast.tpd.Tree] @Repeated + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.TermSymbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: + scala.collection.immutable.List[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Symbols.toDenot(meth)(ctx).info(ctx). + firstParamTypes + .drop(args.length) + val followingArgs: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + ' + ](Typer.this.protoArgs(pt)).zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](followingParams)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }).asInstanceOf[ + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + ] + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + )(ctx) + ).appliedToArgs( + args.toList.++[dotty.tools.dotc.ast.tpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ]' + ](followingArgs)( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ) + )(ctx) + } + def protoArgs(val pt: dotty.tools.dotc.core.Types.Type): + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + = + pt match { + case pt @ _: dotty.tools.dotc.typer.ProtoTypes.FunProto => + pt.args.++[dotty.tools.dotc.ast.untpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]' + ](Typer.this.protoArgs(pt.resultType))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + ) + case _ => + scala.package.Nil + } + def typedTypeApply(val tree: dotty.tools.dotc.ast.untpd.TypeApply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val ntree: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree.asInstanceOf[dotty.tools.dotc.ast.tpd.TypeApply] + )(ctx) + ntree match { + case + dotty.tools.dotc.ast.Trees.TypeApply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fun @ _, args @ _): + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + => + val fun1: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + )(ctx) + fun1.tpe.widen(ctx) match { + case funTpe @ _: dotty.tools.dotc.core.Types.PolyType => + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](args).mapconserve[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.typedType(_$1, Typer.this.typedType$default$2 + ) + (ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.TypeApply(tree)(fun1, args1)( + ctx + ).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd.ListOfTreeDecorator(args1).tpes + )(ctx) + )(ctx) + case _ => + fun1 + } + case _ => + Typer.this.typedExpr(ntree, pt)(ctx) + } + } + def typedApply(val tree: dotty.tools.dotc.ast.untpd.Apply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val $5$: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = + tree: dotty.tools.dotc.ast.untpd.Apply @unchecked match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[Null'](fun @ _, + args @ _ + ) + => + Tuple2.apply[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ]' + ](fun, args) + } + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = $5$._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = $5$._2 + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply + ) + then Typer.this.typedUnadapted(args.head, pt)(ctx) else + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this)( + ctx + ) + )(ctx) match { + case fun1 @ _: dotty.tools.dotc.ast.tpd.Apply => + fun1 + case fun1 @ _ => + fun1.tpe.widen(ctx) match { + case mt @ _: dotty.tools.dotc.core.Types.MethodType => + val outers: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).args( + fun.asInstanceOf[dotty.tools.dotc.ast.tpd.Tree] + ) + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = + { + val $6$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = outers + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]( + args.++[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]' + ](Typer.this.protoArgs(pt))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ] + ).:::[dotty.tools.dotc.ast.Trees.Tree[Null]']($6$) + ) + }.zipWithConserve[dotty.tools.dotc.core.Types.Type']( + mt.paramTypes + )({ + def $anonfun(tree: dotty.tools.dotc.ast.Trees.Tree[Null] + , + pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[Null] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.Apply(tree)(fun1, args1)(ctx) + . + withType(mt.resultType)(ctx) + case _ => + throw + new MatchError( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["tree "," has unexpected type of function ", + ", was " + ,""]: String* + ) + ).i( + [tree,{ + fun1.tpe.widen(ctx) + },{ + fun.typeOpt.widen(ctx) + }]: + (dotty.tools.dotc.ast.untpd.Apply | + dotty.tools.dotc.core.Types.Type + )* + )(ctx) + ) + } + } + } + def typedSeqLiteral(val tree: dotty.tools.dotc.ast.untpd.SeqLiteral, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.SeqLiteral + = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt)(ctx) + )(ctx) + def typedValDef(val vdef: dotty.tools.dotc.ast.untpd.ValDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2)(ctx).withPos( + vdef.tpt.pos + ) + ) + val rhs$1: dotty.tools.dotc.ast.untpd.Tree = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy.ValDef(vdef)(name$3, tpt$1, rhs$1) + }, sym)(ctx) + def typedDefDef(val ddef: dotty.tools.dotc.ast.untpd.DefDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef[dotty.tools.dotc.core.Types.Type] + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx).resultType + val ddef1: dotty.tools.dotc.ast.untpd.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.DefDef$default$2(ddef) + val vparamss$1: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + ] + = { + val $7$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = + ddef.vparamss.flatten[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ] + ) + scala.package.Nil.::[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ]($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2 + )(ctx).withPos(ddef.tpt.pos) + ) + val rhs$2: + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + = + ddef.rhs match { + case + id @ + dotty.tools.dotc.ast.Trees.Ident.unapply[ + dotty.tools.dotc.ast.Trees.Untyped' + ](dotty.tools.dotc.core.StdNames.nme.WILDCARD): + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + => + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe)(ctx) + ) + case _ => + ddef.rhs + } + dotty.tools.dotc.ast.untpd.cpy.DefDef(ddef)(name$4, + scala.package.Nil + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym)(ctx) + } + def typedTypeDef(val tdef: dotty.tools.dotc.ast.untpd.TypeDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree + def typedStats( + val stats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , val exprOwner: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] = { + val stats1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + ] + = + dotty.tools.dotc.ast.Trees.flatten[dotty.tools.dotc.core.Types.Type' + ] + (super.typedStats(stats, exprOwner)(ctx)) + if ctx.owner.isClass then { + val $8$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ] + = stats1 + Typer.this.addBridges(stats, stats1)(ctx).:::[ + dotty.tools.dotc.ast.tpd.Tree' + ]($8$) + } else stats1 + } + def addBridges( + val oldStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val newStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase + ) + def traverse( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] = + { + after match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](member @ _: dotty.tools.dotc.ast.tpd.DefDef, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + => + before match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ](oldMember @ _: dotty.tools.dotc.ast.untpd.DefDef, + oldTail @ _ + ): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + => + val oldSymbol: dotty.tools.dotc.core.Symbols.Symbol = + oldMember.symbol(beforeCtx) + val newSymbol: dotty.tools.dotc.core.Symbols.Symbol = + member.symbol(ctx) + assert(oldSymbol.name(beforeCtx).==(newSymbol.name(ctx)), + StringContext.apply([""," bridging with ",""]: String*).s( + [{ + oldSymbol.name(beforeCtx) + },{ + newSymbol.name(ctx) + }]: (oldSymbol.ThisName | newSymbol.ThisName)* + ) + ) + val newOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldSymbol.denot(ctx).allOverriddenSymbols(ctx).toSet[ + dotty.tools.dotc.core.Symbols.Symbol' + ] + val oldOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + dotty.tools.dotc.core.Symbols.toDenot(newSymbol)(ctx). + allOverriddenSymbols + (beforeCtx).toSet[dotty.tools.dotc.core.Symbols.Symbol'] + def stillInBaseClass( + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + derivesFrom + (dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner)( + ctx + ) + val neededBridges: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldOverridden.--(newOverridden).filter({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol) + : + Boolean = stillInBaseClass(sym) + closure($anonfun) + }) + val minimalSet: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + Set.apply[dotty.tools.dotc.core.Symbols.Symbol]( + []: Nothing* + ) + neededBridges.foreach[Unit']({ + def $anonfun(bridge: dotty.tools.dotc.core.Symbols.Symbol) + : + Unit' = { + val isRequired: Boolean = + minimalSet.forall({ + def $anonfun( + nxtBridge: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx) + . + info(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot(nxtBridge) + ( + ctx).info(ctx) + )(ctx).unary_! + closure($anonfun) + }) + if isRequired then { + val clash: + Option[dotty.tools.dotc.core.Symbols.Symbol] + = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(oldSymbol)( + ctx + ).owner + )(ctx).decls(ctx).lookupAll(bridge.name(ctx))(ctx). + find + ({ + { + def $anonfun( + sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = { + sym.name(ctx).eq(bridge.name(ctx)).&&( + dotty.tools.dotc.core.Symbols.toDenot(sym)( + ctx + ).info(ctx).widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + } + closure($anonfun) + } + }).orElse[dotty.tools.dotc.core.Symbols.Symbol']( + emittedBridges.find({ + def $anonfun( + stat: dotty.tools.dotc.ast.tpd.DefDef + ): Boolean = + stat.name.==(bridge.name(ctx)).&&( + stat.tpe.widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + closure($anonfun) + }).map[dotty.tools.dotc.core.Symbols.Symbol']({ + def $anonfun( + _$2: dotty.tools.dotc.ast.tpd.DefDef + ): dotty.tools.dotc.core.Symbols.Symbol' = + _$2.symbol(ctx) + closure($anonfun) + }) + ) + clash match { + case + Some.unapply[dotty.tools.dotc.core.Symbols.Symbol' + ] + (cl @ _): + Some[dotty.tools.dotc.core.Symbols.Symbol'] + => + ctx.error( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["bridge for method "," of type ","\\n"]: + String* + ) + ).i( + [{ + newSymbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + newSymbol + )(ctx).info(beforeCtx) + }]: + (String | dotty.tools.dotc.core.Types.Type)* + )(ctx).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["clashes with "," of type ","\\n"]: + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(cl)( + ctx + ).symbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(cl + ) + (ctx).symbol + )(ctx).info(beforeCtx) + }]: + (String | dotty.tools.dotc.core.Types.Type + ) + * + )(ctx) + ).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["both have same type after erasure: ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).symbol + )(ctx).info(ctx) + }]: dotty.tools.dotc.core.Types.Type* + )(ctx) + ) + , ctx.error$default$2) + case None => + minimalSet = minimalSet.+(bridge) + } + } else () + } + closure($anonfun) + }) + val bridgeImplementations: + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + minimalSet.map[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + { + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol + ) + : + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + = { + Typer.this.makeBridgeDef(member, sym)(ctx) + } + closure($anonfun) + } + })( + scala.collection.immutable.Set.canBuildFrom[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + emittedBridges.++=(bridgeImplementations) + traverse(newTail, oldTail, traverse$default$3) + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ](notADefDef @ _, oldTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + => + traverse(after, oldTail, traverse$default$3) + } + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](notADefDef @ _, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + => + traverse(newTail, before, traverse$default$3) + } + } + def traverse$default$3: + scala.collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + = + collection.mutable.ListBuffer.apply[dotty.tools.dotc.ast.tpd.DefDef] + ( + []: Nothing*) + traverse(newStats, oldStats, traverse$default$3) + } + def makeBridgeDef(val newDef: dotty.tools.dotc.ast.tpd.DefDef, + val parentSym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.DefDef + = { + def error(val reason: String): Nothing = { + assert(false, + StringContext.apply( + ["failure creating bridge from "," to ",", reason: ",""]: + String* + ).s( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason]: (dotty.tools.dotc.core.Symbols.Symbol | String)* + ) + ) + ??? + } + val bridge: dotty.tools.dotc.core.Symbols.TermSymbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + val name$5: parentSym.ThisName = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ctx.newSymbol$default$5[parentSym.ThisName'] + ctx.newSymbol[parentSym.ThisName'](owner$3, name$5, flags$1, + info$3 + , privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .coord + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase.prev.asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + )(ctx) + ctx.debuglog( + StringContext.apply(["generating bridge from "," to ",""]: String*). + s + ( + [{ + newDef.symbol(ctx) + },bridge]: dotty.tools.dotc.core.Symbols.Symbol* + ) + ) + val sel: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.This[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .asClass + )(ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + termRef + (ctx) + )(ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx).info(ctx).widen( + ctx + ).resultType + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun( + val paramss: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val rhs: dotty.tools.dotc.ast.tpd.Tree = + paramss.foldLeft[dotty.tools.dotc.ast.tpd.Tree'](sel)({ + def $anonfun(fun: dotty.tools.dotc.ast.tpd.Tree, + vparams: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ): dotty.tools.dotc.ast.tpd.Tree = + fun.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(names @ _, + types @ _ + ): dotty.tools.dotc.core.Types.MethodType + => + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + Tuple2.apply[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ](vparams, types) + ).zipped[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + ] + , + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ).map[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + def $anonfun( + _$3: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , _$4: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd.EmptyTree + )(ctx) + closure($anonfun) + })( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + )(ctx) + case a @ _ => + error( + StringContext.apply( + ["can not resolve apply type ",""]: String* + ).s([a]: dotty.tools.dotc.core.Types.Type*) + ) + } + closure($anonfun) + }) + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3)( + ctx + ) + } + closure($anonfun) + } + })(ctx) + } + def adapt(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val original: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + { + val printer$1: + dotty.tools.dotc.config.Printers.Printer @uncheckedVariance + = + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["adapting ",": "," to ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , printer$1, true) + }({ + assert( + ctx.phase.==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase. + next + ) + , ctx.phase) + if tree.isEmpty then tree else + if ctx.mode.is(dotty.tools.dotc.typer.Mode.Pattern) then tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt)( + ctx + ) + }) + } + val Typer: dotty.tools.dotc.transform.Erasure.Typer$ = + new dotty.tools.dotc.transform.Erasure.Typer$() + class Typer$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Typer.type => + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after superaccessors: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure() extends dotty.tools.dotc.util.DotClass() with + dotty.tools.dotc + .core.Phases.Phase with dotty.tools.dotc.core.DenotTransformers. + DenotTransformer + { thisTransformer: dotty.tools.dotc.transform.Erasure => + def phaseName: String = "erasure" + def runsAfter: + scala.collection.immutable.Set[ + Class[_ <: dotty.tools.dotc.core.Phases.Phase] + ] + = + Set.apply[Class[_ <: dotty.tools.dotc.core.Phases.Phase]']( + [classOf[dotty.tools.dotc.transform.InterceptedMethods], + classOf[dotty.tools.dotc.transform.Splitter] + ,classOf[dotty.tools.dotc.transform.ElimRepeated]]: + Class[_ + >: + dotty.tools.dotc.transform.InterceptedMethods & + dotty.tools.dotc.transform.Splitter + & dotty.tools.dotc.transform.ElimRepeated + <: + dotty.tools.dotc.transform.InterceptedMethods | + dotty.tools.dotc.transform.Splitter + | dotty.tools.dotc.transform.ElimRepeated + ]* + ) + def transform(val ref: dotty.tools.dotc.core.Denotations.SingleDenotation) + ( + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Denotations.SingleDenotation + = + ref match { + case ref @ _: dotty.tools.dotc.core.SymDenotations.SymDenotation => + assert(ctx.phase.==(this), + StringContext.apply(["transforming "," at ",""]: String*).s( + [ref,{ + ctx.phase + }]: + (dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + )* + ) + ) + if + ref.symbol.eq(dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass) + then { + val $1$: + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = + ref.info(ctx): dotty.tools.dotc.core.Types.Type @unchecked + match + { + case + dotty.tools.dotc.core.Types.ClassInfo(pre @ _, _, ps @ _, + decls @ _ + , selfInfo @ _): dotty.tools.dotc.core.Types.ClassInfo + => + Tuple4.apply[dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ]' + , dotty.tools.dotc.core.Scopes.Scope', + dotty.tools.dotc.util.DotClass' + ](pre, ps, decls, selfInfo) + } + val pre: dotty.tools.dotc.core.Types.Type = $1$._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = $1$._2 + val decls: dotty.tools.dotc.core.Scopes.Scope = $1$._3 + val selfInfo: dotty.tools.dotc.util.DotClass = $1$._4 + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + )(ctx).classInfo(ctx).decls.foreach[ + dotty.tools.dotc.core.Symbols.Symbol' + ]({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol' + = + extendedScope.enter[dotty.tools.dotc.core.Symbols.Symbol'](sym + ) + (ctx) + closure($anonfun) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$2 + val name$1: dotty.tools.dotc.core.Names.Name @uncheckedVariance + = + ref.copySymDenotation$default$3 + val initFlags$1: + dotty.tools.dotc.core.Flags.FlagSet @uncheckedVariance + = ref.copySymDenotation$default$4 + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + , ps, extendedScope, selfInfo)(ctx) + )(ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$6 + val annotations$1: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Annotations.Annotation + ] @uncheckedVariance + = ref.copySymDenotation$default$7 + ref.copySymDenotation(symbol$1, owner$1, name$1, initFlags$1, + info$1 + , privateWithin$1, annotations$1) + }(ctx) + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = ref.owner + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if oldOwner.eq(dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass else + oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + oldInfo + )(ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~(dotty.tools.dotc.core.Flags.HasDefaultParams) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass)(ctx).unary_! + , + StringContext.apply( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""]: String* + ).s( + [ref,{ + ctx.phase + },oldOwner,newOwner,oldInfo,newInfo,{ + oldOwner.eq(newOwner) + },{ + oldInfo.eq(newInfo) + }]: + ( + dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + | dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + | Boolean)* + ) + ) + { + val symbol$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = newOwner + val name$2: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, initFlags$2, + info$2 + , ref.copySymDenotation$default$6, + ref.copySymDenotation$default$7 + ) + }(ctx) + } + } + case ref @ _ => + ref.derivedSingleDenotation(ref.symbol, + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx))(ctx) + )(ctx) + } + val eraser: dotty.tools.dotc.transform.Erasure.Typer = + new dotty.tools.dotc.transform.Erasure.Typer() + def run(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit + unit.tpdTree_=( + Erasure.this.eraser.typedExpr(unit.tpdTree, + Erasure.this.eraser.typedExpr$default$2 + )(ctx.fresh.setPhase(this.next)) + ) + } + def checkPostCondition(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree)(ctx) + tree match { + case res @ _: dotty.tools.dotc.ast.tpd.This => + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + , res)(ctx).unary_! + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["Reference to "," from ",""]: String*) + ).i( + [res,{ + ctx.owner.showLocated(ctx) + }]: (dotty.tools.dotc.ast.tpd.This | String)* + )(ctx) + ) + case _ => + () + } + } + def assertErased(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt, tree)(ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure. + apply + (tree.symbol(ctx)).unary_! + then Erasure.this.assertErased(tree.typeOpt.widen(ctx), tree)(ctx) + else + () + if ctx.mode.isExpr then + tree.tpe match { + case ref @ _: dotty.tools.dotc.core.Types.TermRef => + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["non-sym type "," of class "," with denot of class "," of " + , + ""]: String* + ) + ).i( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree]: + (dotty.tools.dotc.core.Types.TermRef | Class | + dotty.tools.dotc.ast.tpd.Tree + )* + )(ctx) + ) + case _ => + () + } + else () + } + def assertErased(val tp: dotty.tools.dotc.core.Types.Type, + val tree: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp)(ctx), + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""]: String* + ) + ).i( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe + },{ + tree.getClass() + },{ + ctx.phase + }]: + ( + dotty.tools.dotc.core.Types.Type | String | Class | + dotty.tools.dotc.ast.tpd.Tree + | dotty.tools.dotc.core.Phases.Phase)* + )(ctx) + ) + def assertErased$default$2: dotty.tools.dotc.ast.tpd.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$() extends Object() with dotty.tools.dotc.transform. + TypeTestsCasts + { this: dotty.tools.dotc.transform.Erasure$.type => + val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ = + new dotty.tools.dotc.transform.Erasure.Boxing$() + class Boxing$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Boxing$.type => + + def isUnbox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.unbox).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def isBox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.box).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def boxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.box)(ctx). + symbol + def unboxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.unbox)(ctx) + . + symbol + def safelyRemovableUnboxArg(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + tree match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fn @ _, + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](arg @ _, scala.package.Nil): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + if + dotty.tools.dotc.transform.Erasure.Boxing.isUnbox(fn.symbol(ctx))( + ctx + ).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses. + contains + (arg.tpe.widen(ctx).typeSymbol(ctx)) + ) + => + arg + case _ => + dotty.tools.dotc.ast.tpd.EmptyTree + } + def constant(val tree: dotty.tools.dotc.ast.tpd.Tree, + val const: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree)(ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.tpd.Tree = tree + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($2$) + }, const)(ctx) + def box(val tree: dotty.tools.dotc.ast.tpd.Tree, val target: => String)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["boxing ",": "," into ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },target]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, _) + : + dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx).typeRef + ( + ctx) + , { + val $3$: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + (dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx))( + ctx + ) + )(ctx) + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($3$) + })(ctx) + case tp @ _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).BoxedUnit_UNIT + )(ctx) + )(ctx) + else + if + cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).NothingClass) + then tree else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + val arg: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree)(ctx) + if arg.isEmpty then + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.boxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + else { + ctx.log( + StringContext.apply( + ["boxing an unbox: "," -> ",""]: String* + ).s( + [{ + tree.symbol(ctx) + },{ + arg.tpe + }]: + (dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + )* + ) + ) + arg + } + } + } + }) + def box$default$2: String = "" + def unbox(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["unboxing ",": "," as a ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + pt match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, + underlying @ _ + ): dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + val tree1: dotty.tools.dotc.ast.tpd.Tree = + if + tree.tpe.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).NullClass + )(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + underlying + ).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, + underlying + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Select[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + tree + , + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + . + typeRef(ctx) + )(ctx) + ).select( + dotty.tools.dotc.transform.ValueClasses.valueClassUnbox( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + )(ctx) + )(ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree1, pt)(ctx) + case _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply(()) + )(ctx) + )(ctx) + else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.unboxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + } + } + }) + def cast(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass)(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt)(ctx) else + Tuple2.apply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ](tree.tpe, pt) match { + case + Tuple2.unapply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ]( + dotty.tools.dotc.core.Types.JavaArrayType(treeElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + , + dotty.tools.dotc.core.Types.JavaArrayType(ptElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + ) + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(ptElem) + . + isPrimitiveValueType(ctx).unary_! + ) + => + dotty.tools.dotc.transform.Erasure.Boxing.cast( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod( + dotty.tools.dotc.core.StdNames.nme.toObjectArray + ) + )(ctx) + ).appliedTo(tree)(ctx) + , pt)(ctx) + case _ => + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(pt). + isPrimitiveValueType + (ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree' + ](tree).asInstance(pt)(ctx) + } + } + def adaptToType(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(scala.package.Nil, _): + dotty.tools.dotc.core.Types.MethodType + if tree.isTerm => + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree' + ](tree).appliedToNone(ctx) + , pt)(ctx) + case tpw @ _ => + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType].||( + tree.tpe.<:<(pt)(ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(tpw). + isErasedValueType + (ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(pt) + . + isErasedValueType(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt + ) + (ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + tpw + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx).unary_! + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_! + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree + , + pt)(ctx) + , pt)(ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree, + pt + )(ctx) + } + } + class Typer() extends dotty.tools.dotc.typer.ReTyper() with + dotty.tools.dotc + .typer.NoChecking { + def erasedType(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.TermRef if tree.isTerm => + dotty.tools.dotc.core.TypeErasure.erasedRef(tp)(ctx) + case tp @ _ => + dotty.tools.dotc.core.TypeErasure.erasure(tp)(ctx) + } + def promote(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): tree.ThisTree[dotty.tools.dotc.core.Types.Type]#Apply = { + assert(tree.hasType) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree)(ctx) + ctx.log( + StringContext.apply(["promoting ",": ",""]: String*).s( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying(erased.showWithUnderlying$default$1)( + ctx + ) + }]: String* + ) + ) + tree.withType(erased)(ctx) + } + def typedLiteral(val tree: dotty.tools.dotc.ast.untpd.Literal)( + val ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Literal = + if + tree.typeOpt.isRef(dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass + ) + (ctc) + then tree.withType(tree.typeOpt)(ctc) else + super.typedLiteral(tree)(ctc) + def typedSelect(val tree: dotty.tools.dotc.ast.untpd.Select, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).exists, + tree.show(ctx) + ) + def select(val qual: dotty.tools.dotc.ast.tpd.Tree, + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.tpd.Tree = { + val name: sym.ThisName = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.NamedType if + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tp.name).isInheritedName + => + dotty.tools.dotc.core.NameOps.NameDecorator[sym.ThisName']( + sym.name(ctx) + ).inheritedName + case _ => + sym.name(ctx) + } + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, sym.name(ctx))(ctx + ) + .withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym(qual.tpe, sym)( + ctx + ) + )(ctx) + } + def selectArrayMember(val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx) + then + Typer.this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tree.name).genericArrayOp + , pt, [qual]: dotty.tools.dotc.ast.tpd.Tree*)(ctx) + else + if qual.tpe.<:<(erasedPre)(ctx).unary_! then + selectArrayMember( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, erasedPre + ) + (ctx) + , erasedPre) + else + Typer.this.assignType( + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tree.name).primitiveArrayOp + )(ctx) + , qual)(ctx) + def adaptIfSuper(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = + qual match { + case + dotty.tools.dotc.ast.Trees.Super.unapply[ + dotty.tools.dotc.core.Types.Type' + ](thisQual @ _, dotty.tools.dotc.core.StdNames.tpnme.EMPTY): + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + => + val $4$: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = + qual.tpe: dotty.tools.dotc.core.Types.Type @unchecked match { + case + dotty.tools.dotc.core.Types.SuperType(thisType @ _, + supType @ _ + ): dotty.tools.dotc.core.Types.SuperType + => + Tuple2.apply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ](thisType, supType) + } + val thisType: dotty.tools.dotc.core.Types.Type = $4$._1 + val supType: dotty.tools.dotc.core.Types.Type = $4$._2 + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).is(dotty.tools.dotc.core.Flags.Trait)(ctx) + then + dotty.tools.dotc.ast.tpd.cpy.Super(qual)(thisQual, + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner. + asClass + .name(ctx) + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + )(ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + thisType.firstParent(ctx) + )(ctx) + )(ctx) + case _ => + qual + } + def recur(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe.widen(ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).isConstructor + , + StringContext.apply(["",""]: String*).s( + [{ + sym.showLocated(ctx) + }]: String* + ) + ) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx).info(ctx).decl(sym.name(ctx))(ctx).symbol + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe + ).isErasedValueType(ctx) + ) + then + recur( + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + ) + else + if qualIsPrimitive.unary_!.&&(symIsPrimitive) then + recur( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass + ) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier.typeOpt.widen(ctx).finalResultType + )(ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.tpd.Tree = + adaptIfSuper(qual) + if + qual1.tpe.derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.tpd.Super] + ) + then select(qual1, sym) else + recur( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx). + owner + )(ctx).typeRef(ctx) + )(ctx) + ) + } + } + recur( + Typer.this.typed(tree.qualifier, + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + )(ctx) + ) + } + def typedSelectFromTypeTree( + val tree: dotty.tools.dotc.ast.untpd.SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.Type)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name).withPos(tree.pos).withType + ( + Typer.this.erasedType(tree)(ctx))(ctx) + def typedThis(val tree: dotty.tools.dotc.ast.untpd.This)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx))(ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree)(ctx) else { + ctx.log( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["computing outer path from ","%, % to ",", encl class = ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + ownersIterator + (ctx).toList + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + }]: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Symbols.Symbol + ] + | dotty.tools.dotc.core.Symbols.Symbol)* + )(ctx) + ) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs(val name: dotty.tools.dotc.core.Names.Name + , + val pt: dotty.tools.dotc.core.Types.Type, + val args: + scala.collection.Seq[dotty.tools.dotc.ast.tpd.Tree] @Repeated + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.TermSymbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: + scala.collection.immutable.List[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Symbols.toDenot(meth)(ctx).info(ctx). + firstParamTypes + .drop(args.length) + val followingArgs: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + ' + ](Typer.this.protoArgs(pt)).zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](followingParams)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }).asInstanceOf[ + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + ] + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + )(ctx) + ).appliedToArgs( + args.toList.++[dotty.tools.dotc.ast.tpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ]' + ](followingArgs)( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ) + )(ctx) + } + def protoArgs(val pt: dotty.tools.dotc.core.Types.Type): + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + = + pt match { + case pt @ _: dotty.tools.dotc.typer.ProtoTypes.FunProto => + pt.args.++[dotty.tools.dotc.ast.untpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]' + ](Typer.this.protoArgs(pt.resultType))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + ) + case _ => + scala.package.Nil + } + def typedTypeApply(val tree: dotty.tools.dotc.ast.untpd.TypeApply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val ntree: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree.asInstanceOf[dotty.tools.dotc.ast.tpd.TypeApply] + )(ctx) + ntree match { + case + dotty.tools.dotc.ast.Trees.TypeApply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fun @ _, args @ _): + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + => + val fun1: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + )(ctx) + fun1.tpe.widen(ctx) match { + case funTpe @ _: dotty.tools.dotc.core.Types.PolyType => + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](args).mapconserve[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.typedType(_$1, Typer.this.typedType$default$2 + ) + (ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.TypeApply(tree)(fun1, args1)( + ctx + ).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd.ListOfTreeDecorator(args1).tpes + )(ctx) + )(ctx) + case _ => + fun1 + } + case _ => + Typer.this.typedExpr(ntree, pt)(ctx) + } + } + def typedApply(val tree: dotty.tools.dotc.ast.untpd.Apply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val $5$: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = + tree: dotty.tools.dotc.ast.untpd.Apply @unchecked match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[Null'](fun @ _, + args @ _ + ) + => + Tuple2.apply[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ]' + ](fun, args) + } + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = $5$._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = $5$._2 + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply + ) + then Typer.this.typedUnadapted(args.head, pt)(ctx) else + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this)( + ctx + ) + )(ctx) match { + case fun1 @ _: dotty.tools.dotc.ast.tpd.Apply => + fun1 + case fun1 @ _ => + fun1.tpe.widen(ctx) match { + case mt @ _: dotty.tools.dotc.core.Types.MethodType => + val outers: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).args( + fun.asInstanceOf[dotty.tools.dotc.ast.tpd.Tree] + ) + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = + { + val $6$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = outers + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]( + args.++[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]' + ](Typer.this.protoArgs(pt))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ] + ).:::[dotty.tools.dotc.ast.Trees.Tree[Null]']($6$) + ) + }.zipWithConserve[dotty.tools.dotc.core.Types.Type']( + mt.paramTypes + )({ + def $anonfun(tree: dotty.tools.dotc.ast.Trees.Tree[Null] + , + pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[Null] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.Apply(tree)(fun1, args1)(ctx) + . + withType(mt.resultType)(ctx) + case _ => + throw + new MatchError( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["tree "," has unexpected type of function ", + ", was " + ,""]: String* + ) + ).i( + [tree,{ + fun1.tpe.widen(ctx) + },{ + fun.typeOpt.widen(ctx) + }]: + (dotty.tools.dotc.ast.untpd.Apply | + dotty.tools.dotc.core.Types.Type + )* + )(ctx) + ) + } + } + } + def typedSeqLiteral(val tree: dotty.tools.dotc.ast.untpd.SeqLiteral, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.SeqLiteral + = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt)(ctx) + )(ctx) + def typedValDef(val vdef: dotty.tools.dotc.ast.untpd.ValDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2)(ctx).withPos( + vdef.tpt.pos + ) + ) + val rhs$1: dotty.tools.dotc.ast.untpd.Tree = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy.ValDef(vdef)(name$3, tpt$1, rhs$1) + }, sym)(ctx) + def typedDefDef(val ddef: dotty.tools.dotc.ast.untpd.DefDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef[dotty.tools.dotc.core.Types.Type] + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx).resultType + val ddef1: dotty.tools.dotc.ast.untpd.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.DefDef$default$2(ddef) + val vparamss$1: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + ] + = { + val $7$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = + ddef.vparamss.flatten[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ] + ) + scala.package.Nil.::[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ]($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2 + )(ctx).withPos(ddef.tpt.pos) + ) + val rhs$2: + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + = + ddef.rhs match { + case + id @ + dotty.tools.dotc.ast.Trees.Ident.unapply[ + dotty.tools.dotc.ast.Trees.Untyped' + ](dotty.tools.dotc.core.StdNames.nme.WILDCARD): + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + => + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe)(ctx) + ) + case _ => + ddef.rhs + } + dotty.tools.dotc.ast.untpd.cpy.DefDef(ddef)(name$4, + scala.package.Nil + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym)(ctx) + } + def typedTypeDef(val tdef: dotty.tools.dotc.ast.untpd.TypeDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree + def typedStats( + val stats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , val exprOwner: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] = { + val stats1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + ] + = + dotty.tools.dotc.ast.Trees.flatten[dotty.tools.dotc.core.Types.Type' + ] + (super.typedStats(stats, exprOwner)(ctx)) + if ctx.owner.isClass then { + val $8$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ] + = stats1 + Typer.this.addBridges(stats, stats1)(ctx).:::[ + dotty.tools.dotc.ast.tpd.Tree' + ]($8$) + } else stats1 + } + def addBridges( + val oldStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val newStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase + ) + def traverse( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] = + { + after match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](member @ _: dotty.tools.dotc.ast.tpd.DefDef, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + => + before match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ](oldMember @ _: dotty.tools.dotc.ast.untpd.DefDef, + oldTail @ _ + ): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + => + val oldSymbol: dotty.tools.dotc.core.Symbols.Symbol = + oldMember.symbol(beforeCtx) + val newSymbol: dotty.tools.dotc.core.Symbols.Symbol = + member.symbol(ctx) + assert(oldSymbol.name(beforeCtx).==(newSymbol.name(ctx)), + StringContext.apply([""," bridging with ",""]: String*).s( + [{ + oldSymbol.name(beforeCtx) + },{ + newSymbol.name(ctx) + }]: (oldSymbol.ThisName | newSymbol.ThisName)* + ) + ) + val newOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldSymbol.denot(ctx).allOverriddenSymbols(ctx).toSet[ + dotty.tools.dotc.core.Symbols.Symbol' + ] + val oldOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + dotty.tools.dotc.core.Symbols.toDenot(newSymbol)(ctx). + allOverriddenSymbols + (beforeCtx).toSet[dotty.tools.dotc.core.Symbols.Symbol'] + def stillInBaseClass( + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + derivesFrom + (dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner)( + ctx + ) + val neededBridges: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldOverridden.--(newOverridden).filter({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol) + : + Boolean = stillInBaseClass(sym) + closure($anonfun) + }) + val minimalSet: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + Set.apply[dotty.tools.dotc.core.Symbols.Symbol]( + []: Nothing* + ) + neededBridges.foreach[Unit']({ + def $anonfun(bridge: dotty.tools.dotc.core.Symbols.Symbol) + : + Unit' = { + val isRequired: Boolean = + minimalSet.forall({ + def $anonfun( + nxtBridge: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx) + . + info(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot(nxtBridge) + ( + ctx).info(ctx) + )(ctx).unary_! + closure($anonfun) + }) + if isRequired then { + val clash: + Option[dotty.tools.dotc.core.Symbols.Symbol] + = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(oldSymbol)( + ctx + ).owner + )(ctx).decls(ctx).lookupAll(bridge.name(ctx))(ctx). + find + ({ + { + def $anonfun( + sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = { + sym.name(ctx).eq(bridge.name(ctx)).&&( + dotty.tools.dotc.core.Symbols.toDenot(sym)( + ctx + ).info(ctx).widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + } + closure($anonfun) + } + }).orElse[dotty.tools.dotc.core.Symbols.Symbol']( + emittedBridges.find({ + def $anonfun( + stat: dotty.tools.dotc.ast.tpd.DefDef + ): Boolean = + stat.name.==(bridge.name(ctx)).&&( + stat.tpe.widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + closure($anonfun) + }).map[dotty.tools.dotc.core.Symbols.Symbol']({ + def $anonfun( + _$2: dotty.tools.dotc.ast.tpd.DefDef + ): dotty.tools.dotc.core.Symbols.Symbol' = + _$2.symbol(ctx) + closure($anonfun) + }) + ) + clash match { + case + Some.unapply[dotty.tools.dotc.core.Symbols.Symbol' + ] + (cl @ _): + Some[dotty.tools.dotc.core.Symbols.Symbol'] + => + ctx.error( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["bridge for method "," of type ","\\n"]: + String* + ) + ).i( + [{ + newSymbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + newSymbol + )(ctx).info(beforeCtx) + }]: + (String | dotty.tools.dotc.core.Types.Type)* + )(ctx).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["clashes with "," of type ","\\n"]: + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(cl)( + ctx + ).symbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(cl + ) + (ctx).symbol + )(ctx).info(beforeCtx) + }]: + (String | dotty.tools.dotc.core.Types.Type + ) + * + )(ctx) + ).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["both have same type after erasure: ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).symbol + )(ctx).info(ctx) + }]: dotty.tools.dotc.core.Types.Type* + )(ctx) + ) + , ctx.error$default$2) + case None => + minimalSet = minimalSet.+(bridge) + } + } else () + } + closure($anonfun) + }) + val bridgeImplementations: + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + minimalSet.map[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + { + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol + ) + : + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + = { + Typer.this.makeBridgeDef(member, sym)(ctx) + } + closure($anonfun) + } + })( + scala.collection.immutable.Set.canBuildFrom[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + emittedBridges.++=(bridgeImplementations) + traverse(newTail, oldTail, traverse$default$3) + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ](notADefDef @ _, oldTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + => + traverse(after, oldTail, traverse$default$3) + } + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](notADefDef @ _, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + => + traverse(newTail, before, traverse$default$3) + } + } + def traverse$default$3: + scala.collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + = + collection.mutable.ListBuffer.apply[dotty.tools.dotc.ast.tpd.DefDef] + ( + []: Nothing*) + traverse(newStats, oldStats, traverse$default$3) + } + def makeBridgeDef(val newDef: dotty.tools.dotc.ast.tpd.DefDef, + val parentSym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.DefDef + = { + def error(val reason: String): Nothing = { + assert(false, + StringContext.apply( + ["failure creating bridge from "," to ",", reason: ",""]: + String* + ).s( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason]: (dotty.tools.dotc.core.Symbols.Symbol | String)* + ) + ) + ??? + } + val bridge: dotty.tools.dotc.core.Symbols.TermSymbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + val name$5: parentSym.ThisName = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ctx.newSymbol$default$5[parentSym.ThisName'] + ctx.newSymbol[parentSym.ThisName'](owner$3, name$5, flags$1, + info$3 + , privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .coord + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase.prev.asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + )(ctx) + ctx.debuglog( + StringContext.apply(["generating bridge from "," to ",""]: String*). + s + ( + [{ + newDef.symbol(ctx) + },bridge]: dotty.tools.dotc.core.Symbols.Symbol* + ) + ) + val sel: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.This[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .asClass + )(ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + termRef + (ctx) + )(ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx).info(ctx).widen( + ctx + ).resultType + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun( + val paramss: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val rhs: dotty.tools.dotc.ast.tpd.Tree = + paramss.foldLeft[dotty.tools.dotc.ast.tpd.Tree'](sel)({ + def $anonfun(fun: dotty.tools.dotc.ast.tpd.Tree, + vparams: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ): dotty.tools.dotc.ast.tpd.Tree = + fun.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(names @ _, + types @ _ + ): dotty.tools.dotc.core.Types.MethodType + => + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + Tuple2.apply[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ](vparams, types) + ).zipped[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + ] + , + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ).map[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + def $anonfun( + _$3: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , _$4: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd.EmptyTree + )(ctx) + closure($anonfun) + })( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + )(ctx) + case a @ _ => + error( + StringContext.apply( + ["can not resolve apply type ",""]: String* + ).s([a]: dotty.tools.dotc.core.Types.Type*) + ) + } + closure($anonfun) + }) + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3)( + ctx + ) + } + closure($anonfun) + } + })(ctx) + } + def adapt(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val original: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + { + val printer$1: + dotty.tools.dotc.config.Printers.Printer @uncheckedVariance + = + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["adapting ",": "," to ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , printer$1, true) + }({ + assert( + ctx.phase.==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase. + next + ) + , ctx.phase) + if tree.isEmpty then tree else + if ctx.mode.is(dotty.tools.dotc.typer.Mode.Pattern) then tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt)( + ctx + ) + }) + } + val Typer: dotty.tools.dotc.transform.Erasure.Typer$ = + new dotty.tools.dotc.transform.Erasure.Typer$() + class Typer$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Typer.type => + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after TreeTransform:{refchecks, elimRepeated, elimLocals, extmethods, tailrec}: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure() extends dotty.tools.dotc.util.DotClass() with + dotty.tools.dotc + .core.Phases.Phase with dotty.tools.dotc.core.DenotTransformers. + DenotTransformer + { thisTransformer: dotty.tools.dotc.transform.Erasure => + def phaseName: String = "erasure" + def runsAfter: + scala.collection.immutable.Set[ + Class[_ <: dotty.tools.dotc.core.Phases.Phase] + ] + = + Set.apply[Class[_ <: dotty.tools.dotc.core.Phases.Phase]']( + [classOf[dotty.tools.dotc.transform.InterceptedMethods], + classOf[dotty.tools.dotc.transform.Splitter] + ,classOf[dotty.tools.dotc.transform.ElimRepeated]]: + Class[_ + >: + dotty.tools.dotc.transform.InterceptedMethods & + dotty.tools.dotc.transform.Splitter + & dotty.tools.dotc.transform.ElimRepeated + <: + dotty.tools.dotc.transform.InterceptedMethods | + dotty.tools.dotc.transform.Splitter + | dotty.tools.dotc.transform.ElimRepeated + ]* + ) + def transform(val ref: dotty.tools.dotc.core.Denotations.SingleDenotation) + ( + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Denotations.SingleDenotation + = + ref match { + case ref @ _: dotty.tools.dotc.core.SymDenotations.SymDenotation => + assert(ctx.phase.==(this), + StringContext.apply(["transforming "," at ",""]: String*).s( + [ref,{ + ctx.phase + }]: + (dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + )* + ) + ) + if + ref.symbol.eq(dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass) + then { + val $1$: + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = + ref.info(ctx): dotty.tools.dotc.core.Types.Type @unchecked + match + { + case + dotty.tools.dotc.core.Types.ClassInfo(pre @ _, _, ps @ _, + decls @ _ + , selfInfo @ _): dotty.tools.dotc.core.Types.ClassInfo + => + Tuple4.apply[dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ]' + , dotty.tools.dotc.core.Scopes.Scope', + dotty.tools.dotc.util.DotClass' + ](pre, ps, decls, selfInfo) + } + val pre: dotty.tools.dotc.core.Types.Type = $1$._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = $1$._2 + val decls: dotty.tools.dotc.core.Scopes.Scope = $1$._3 + val selfInfo: dotty.tools.dotc.util.DotClass = $1$._4 + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + )(ctx).classInfo(ctx).decls.foreach[ + dotty.tools.dotc.core.Symbols.Symbol' + ]({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol' + = + extendedScope.enter[dotty.tools.dotc.core.Symbols.Symbol'](sym + ) + (ctx) + closure($anonfun) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$2 + val name$1: dotty.tools.dotc.core.Names.Name @uncheckedVariance + = + ref.copySymDenotation$default$3 + val initFlags$1: + dotty.tools.dotc.core.Flags.FlagSet @uncheckedVariance + = ref.copySymDenotation$default$4 + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + , ps, extendedScope, selfInfo)(ctx) + )(ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$6 + val annotations$1: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Annotations.Annotation + ] @uncheckedVariance + = ref.copySymDenotation$default$7 + ref.copySymDenotation(symbol$1, owner$1, name$1, initFlags$1, + info$1 + , privateWithin$1, annotations$1) + }(ctx) + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = ref.owner + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if oldOwner.eq(dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass else + oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol, + oldInfo + )(ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~(dotty.tools.dotc.core.Flags.HasDefaultParams) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass)(ctx).unary_! + , + StringContext.apply( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""]: String* + ).s( + [ref,{ + ctx.phase + },oldOwner,newOwner,oldInfo,newInfo,{ + oldOwner.eq(newOwner) + },{ + oldInfo.eq(newInfo) + }]: + ( + dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + | dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + | Boolean)* + ) + ) + { + val symbol$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = newOwner + val name$2: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, initFlags$2, + info$2 + , ref.copySymDenotation$default$6, + ref.copySymDenotation$default$7 + ) + }(ctx) + } + } + case ref @ _ => + ref.derivedSingleDenotation(ref.symbol, + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx))(ctx) + )(ctx) + } + val eraser: dotty.tools.dotc.transform.Erasure.Typer = + new dotty.tools.dotc.transform.Erasure.Typer() + def run(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit + unit.tpdTree_=( + Erasure.this.eraser.typedExpr(unit.tpdTree, + Erasure.this.eraser.typedExpr$default$2 + )(ctx.fresh.setPhase(this.next)) + ) + } + def checkPostCondition(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree)(ctx) + tree match { + case res @ _: dotty.tools.dotc.ast.tpd.This => + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + , res)(ctx).unary_! + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["Reference to "," from ",""]: String*) + ).i( + [res,{ + ctx.owner.showLocated(ctx) + }]: (dotty.tools.dotc.ast.tpd.This | String)* + )(ctx) + ) + case _ => + () + } + } + def assertErased(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt, tree)(ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure. + apply + (tree.symbol(ctx)).unary_! + then Erasure.this.assertErased(tree.typeOpt.widen(ctx), tree)(ctx) + else + () + if ctx.mode.isExpr then + tree.tpe match { + case ref @ _: dotty.tools.dotc.core.Types.TermRef => + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["non-sym type "," of class "," with denot of class "," of " + , + ""]: String* + ) + ).i( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree]: + (dotty.tools.dotc.core.Types.TermRef | Class | + dotty.tools.dotc.ast.tpd.Tree + )* + )(ctx) + ) + case _ => + () + } + else () + } + def assertErased(val tp: dotty.tools.dotc.core.Types.Type, + val tree: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp)(ctx), + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""]: String* + ) + ).i( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe + },{ + tree.getClass() + },{ + ctx.phase + }]: + ( + dotty.tools.dotc.core.Types.Type | String | Class | + dotty.tools.dotc.ast.tpd.Tree + | dotty.tools.dotc.core.Phases.Phase)* + )(ctx) + ) + def assertErased$default$2: dotty.tools.dotc.ast.tpd.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$() extends Object() with dotty.tools.dotc.transform. + TypeTestsCasts + { this: dotty.tools.dotc.transform.Erasure$.type => + val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ = + new dotty.tools.dotc.transform.Erasure.Boxing$() + class Boxing$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Boxing$.type => + + def isUnbox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.unbox).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def isBox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.box).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def boxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.box)(ctx). + symbol + def unboxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.unbox)(ctx) + . + symbol + def safelyRemovableUnboxArg(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + tree match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fn @ _, + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](arg @ _, scala.package.Nil): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + if + dotty.tools.dotc.transform.Erasure.Boxing.isUnbox(fn.symbol(ctx))( + ctx + ).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses. + contains + (arg.tpe.widen(ctx).typeSymbol(ctx)) + ) + => + arg + case _ => + dotty.tools.dotc.ast.tpd.EmptyTree + } + def constant(val tree: dotty.tools.dotc.ast.tpd.Tree, + val const: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree)(ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.tpd.Tree = tree + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($2$) + }, const)(ctx) + def box(val tree: dotty.tools.dotc.ast.tpd.Tree, val target: => String)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["boxing ",": "," into ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },target]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, _) + : + dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx).typeRef + ( + ctx) + , { + val $3$: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + (dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx))( + ctx + ) + )(ctx) + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($3$) + })(ctx) + case tp @ _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).BoxedUnit_UNIT + )(ctx) + )(ctx) + else + if + cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).NothingClass) + then tree else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + val arg: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree)(ctx) + if arg.isEmpty then + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.boxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + else { + ctx.log( + StringContext.apply( + ["boxing an unbox: "," -> ",""]: String* + ).s( + [{ + tree.symbol(ctx) + },{ + arg.tpe + }]: + (dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + )* + ) + ) + arg + } + } + } + }) + def box$default$2: String = "" + def unbox(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["unboxing ",": "," as a ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + pt match { + case + dotty.tools.dotc.core.TypeErasure.ErasedValueType(clazz @ _, + underlying @ _ + ): dotty.tools.dotc.core.TypeErasure.ErasedValueType + => + val tree1: dotty.tools.dotc.ast.tpd.Tree = + if + tree.tpe.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).NullClass + )(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + underlying + ).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, + underlying + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Select[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType( + tree + , + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + . + typeRef(ctx) + )(ctx) + ).select( + dotty.tools.dotc.transform.ValueClasses.valueClassUnbox( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz)(ctx) + )(ctx) + )(ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree1, pt)(ctx) + case _ => + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if cls.eq(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass) + then + + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree, + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply(()) + )(ctx) + )(ctx) + else { + assert( + cls.ne(dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass) + ) + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.unboxMethod( + cls.asClass + )(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + } + } + }) + def cast(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel11( + val $this: dotty.tools.dotc.transform.Erasure.Boxing$.type + )(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass)(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt)(ctx) + else + Tuple2.apply[dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ](tree.tpe, pt) match { + case + Tuple2.unapply[dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ]( + dotty.tools.dotc.core.Types.JavaArrayType(treeElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + , + dotty.tools.dotc.core.Types.JavaArrayType(ptElem @ _): + dotty.tools.dotc.core.Types.JavaArrayType + ) + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(ptElem) + . + isPrimitiveValueType(ctx).unary_! + ) + => + tailLabel11($this)( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod( + dotty.tools.dotc.core.StdNames.nme.toObjectArray + ) + )(ctx) + ).appliedTo(tree)(ctx) + , pt)(ctx) + case _ => + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(pt). + isPrimitiveValueType + (ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[dotty.tools.dotc.ast.tpd.Tree + ] + (tree).asInstance(pt)(ctx) + } + } + tailLabel11(Boxing$.this)(tree, pt)(ctx) + } + def adaptToType(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel12( + val $this: dotty.tools.dotc.transform.Erasure.Boxing$.type + )(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else + tree.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(scala.package.Nil, _): + dotty.tools.dotc.core.Types.MethodType + if tree.isTerm => + tailLabel12($this)( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree + ](tree).appliedToNone(ctx) + , pt)(ctx) + case tpw @ _ => + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType].||( + tree.tpe.<:<(pt)(ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils(tpw + ) + .isErasedValueType(ctx) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + pt + ).isErasedValueType(ctx) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, + pt + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_! + ) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_! + ) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt)(ctx) + , pt)(ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree + , + pt)(ctx) + } + tailLabel12(Boxing$.this)(tree, pt)(ctx) + } + } + class Typer() extends dotty.tools.dotc.typer.ReTyper() with + dotty.tools.dotc + .typer.NoChecking { + def erasedType(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.TermRef if tree.isTerm => + dotty.tools.dotc.core.TypeErasure.erasedRef(tp)(ctx) + case tp @ _ => + dotty.tools.dotc.core.TypeErasure.erasure(tp)(ctx) + } + def promote(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): tree.ThisTree[dotty.tools.dotc.core.Types.Type]#Apply = { + assert(tree.hasType) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree)(ctx) + ctx.log( + StringContext.apply(["promoting ",": ",""]: String*).s( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying(erased.showWithUnderlying$default$1)( + ctx + ) + }]: String* + ) + ) + tree.withType(erased)(ctx) + } + def typedLiteral(val tree: dotty.tools.dotc.ast.untpd.Literal)( + val ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Literal = + if + tree.typeOpt.isRef(dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass + ) + (ctc) + then tree.withType(tree.typeOpt)(ctc) else + super.typedLiteral(tree)(ctc) + def typedSelect(val tree: dotty.tools.dotc.ast.untpd.Select, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).exists, + tree.show(ctx) + ) + def select(val qual: dotty.tools.dotc.ast.tpd.Tree, + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.tpd.Tree = { + val name: sym.ThisName = + tree.typeOpt match { + case tp @ _: dotty.tools.dotc.core.Types.NamedType if + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tp.name).isInheritedName + => + dotty.tools.dotc.core.NameOps.NameDecorator[sym.ThisName']( + sym.name(ctx) + ).inheritedName + case _ => + sym.name(ctx) + } + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, sym.name(ctx))(ctx + ) + .withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym(qual.tpe, sym)( + ctx + ) + )(ctx) + } + def selectArrayMember(val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = { + def tailLabel14(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name + ](tree.name).genericArrayOp + , pt, [qual]: dotty.tools.dotc.ast.tpd.Tree*)(ctx) + else + if qual.tpe.<:<(erasedPre)(ctx).unary_! then + tailLabel14($this)( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, + erasedPre + )(ctx) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name + ](tree.name).primitiveArrayOp + )(ctx) + , qual)(ctx) + tailLabel14(Typer.this)(qual, erasedPre) + } + def adaptIfSuper(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = + qual match { + case + dotty.tools.dotc.ast.Trees.Super.unapply[ + dotty.tools.dotc.core.Types.Type' + ](thisQual @ _, dotty.tools.dotc.core.StdNames.tpnme.EMPTY): + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + => + val $4$: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = + qual.tpe: dotty.tools.dotc.core.Types.Type @unchecked match { + case + dotty.tools.dotc.core.Types.SuperType(thisType @ _, + supType @ _ + ): dotty.tools.dotc.core.Types.SuperType + => + Tuple2.apply[dotty.tools.dotc.core.Types.Type', + dotty.tools.dotc.core.Types.Type' + ](thisType, supType) + } + val thisType: dotty.tools.dotc.core.Types.Type = $4$._1 + val supType: dotty.tools.dotc.core.Types.Type = $4$._2 + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).is(dotty.tools.dotc.core.Flags.Trait)(ctx) + then + dotty.tools.dotc.ast.tpd.cpy.Super(qual)(thisQual, + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner. + asClass + .name(ctx) + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + )(ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply(thisType, + thisType.firstParent(ctx) + )(ctx) + )(ctx) + case _ => + qual + } + def recur(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel16(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe.widen(ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).isConstructor + , + StringContext.apply(["",""]: String*).s( + [{ + sym.showLocated(ctx) + }]: String* + ) + ) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx).info(ctx).decl(sym.name(ctx))(ctx).symbol + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe + ).isErasedValueType(ctx) + ) + then + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + ) + else + if qualIsPrimitive.unary_!.&&(symIsPrimitive) then + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass + ) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier.typeOpt.widen(ctx).finalResultType + )(ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.tpd.Tree = + adaptIfSuper(qual) + if + qual1.tpe.derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.tpd.Super] + ) + then select(qual1, sym) else + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx). + owner + )(ctx).typeRef(ctx) + )(ctx) + ) + } + } + tailLabel16(Typer.this)(qual) + } + recur( + Typer.this.typed(tree.qualifier, + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + )(ctx) + ) + } + def typedSelectFromTypeTree( + val tree: dotty.tools.dotc.ast.untpd.SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.Type)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name).withPos(tree.pos).withType + ( + Typer.this.erasedType(tree)(ctx))(ctx) + def typedThis(val tree: dotty.tools.dotc.ast.untpd.This)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx))(ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree)(ctx) else { + ctx.log( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["computing outer path from ","%, % to ",", encl class = ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + ownersIterator + (ctx).toList + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + }]: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Symbols.Symbol + ] + | dotty.tools.dotc.core.Symbols.Symbol)* + )(ctx) + ) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs(val name: dotty.tools.dotc.core.Names.Name + , + val pt: dotty.tools.dotc.core.Types.Type, + val args: + scala.collection.Seq[dotty.tools.dotc.ast.tpd.Tree] @Repeated + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.TermSymbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: + scala.collection.immutable.List[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Symbols.toDenot(meth)(ctx).info(ctx). + firstParamTypes + .drop(args.length) + val followingArgs: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + ' + ](Typer.this.protoArgs(pt)).zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](followingParams)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }).asInstanceOf[ + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + ] + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + )(ctx) + ).appliedToArgs( + args.toList.++[dotty.tools.dotc.ast.tpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ]' + ](followingArgs)( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ) + )(ctx) + } + def protoArgs(val pt: dotty.tools.dotc.core.Types.Type): + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + = + pt match { + case pt @ _: dotty.tools.dotc.typer.ProtoTypes.FunProto => + pt.args.++[dotty.tools.dotc.ast.untpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]' + ](Typer.this.protoArgs(pt.resultType))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + ) + case _ => + scala.package.Nil + } + def typedTypeApply(val tree: dotty.tools.dotc.ast.untpd.TypeApply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val ntree: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree.asInstanceOf[dotty.tools.dotc.ast.tpd.TypeApply] + )(ctx) + ntree match { + case + dotty.tools.dotc.ast.Trees.TypeApply.unapply[ + dotty.tools.dotc.core.Types.Type' + ](fun @ _, args @ _): + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + => + val fun1: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + )(ctx) + fun1.tpe.widen(ctx) match { + case funTpe @ _: dotty.tools.dotc.core.Types.PolyType => + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](args).mapconserve[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.typedType(_$1, Typer.this.typedType$default$2 + ) + (ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.TypeApply(tree)(fun1, args1)( + ctx + ).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd.ListOfTreeDecorator(args1).tpes + )(ctx) + )(ctx) + case _ => + fun1 + } + case _ => + Typer.this.typedExpr(ntree, pt)(ctx) + } + } + def typedApply(val tree: dotty.tools.dotc.ast.untpd.Apply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val $5$: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = + tree: dotty.tools.dotc.ast.untpd.Apply @unchecked match { + case + dotty.tools.dotc.ast.Trees.Apply.unapply[Null'](fun @ _, + args @ _ + ) + => + Tuple2.apply[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ]' + ](fun, args) + } + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = $5$._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = $5$._2 + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply + ) + then Typer.this.typedUnadapted(args.head, pt)(ctx) else + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this)( + ctx + ) + )(ctx) match { + case fun1 @ _: dotty.tools.dotc.ast.tpd.Apply => + fun1 + case fun1 @ _ => + fun1.tpe.widen(ctx) match { + case mt @ _: dotty.tools.dotc.core.Types.MethodType => + val outers: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).args( + fun.asInstanceOf[dotty.tools.dotc.ast.tpd.Tree] + ) + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = + { + val $6$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = outers + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]( + args.++[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]' + ](Typer.this.protoArgs(pt))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ] + ).:::[dotty.tools.dotc.ast.Trees.Tree[Null]']($6$) + ) + }.zipWithConserve[dotty.tools.dotc.core.Types.Type']( + mt.paramTypes + )({ + def $anonfun(tree: dotty.tools.dotc.ast.Trees.Tree[Null] + , + pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[Null] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.Apply(tree)(fun1, args1)(ctx) + . + withType(mt.resultType)(ctx) + case _ => + throw + new MatchError( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["tree "," has unexpected type of function ", + ", was " + ,""]: String* + ) + ).i( + [tree,{ + fun1.tpe.widen(ctx) + },{ + fun.typeOpt.widen(ctx) + }]: + (dotty.tools.dotc.ast.untpd.Apply | + dotty.tools.dotc.core.Types.Type + )* + )(ctx) + ) + } + } + } + def typedSeqLiteral(val tree: dotty.tools.dotc.ast.untpd.SeqLiteral, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.SeqLiteral + = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt)(ctx) + )(ctx) + def typedValDef(val vdef: dotty.tools.dotc.ast.untpd.ValDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2)(ctx).withPos( + vdef.tpt.pos + ) + ) + val rhs$1: dotty.tools.dotc.ast.untpd.Tree = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy.ValDef(vdef)(name$3, tpt$1, rhs$1) + }, sym)(ctx) + def typedDefDef(val ddef: dotty.tools.dotc.ast.untpd.DefDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef[dotty.tools.dotc.core.Types.Type] + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx).resultType + val ddef1: dotty.tools.dotc.ast.untpd.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.DefDef$default$2(ddef) + val vparamss$1: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + ] + = { + val $7$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = + ddef.vparamss.flatten[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ] + ) + scala.package.Nil.::[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ]($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2 + )(ctx).withPos(ddef.tpt.pos) + ) + val rhs$2: + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + = + ddef.rhs match { + case + id @ + dotty.tools.dotc.ast.Trees.Ident.unapply[ + dotty.tools.dotc.ast.Trees.Untyped' + ](dotty.tools.dotc.core.StdNames.nme.WILDCARD): + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + => + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe)(ctx) + ) + case _ => + ddef.rhs + } + dotty.tools.dotc.ast.untpd.cpy.DefDef(ddef)(name$4, + scala.package.Nil + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym)(ctx) + } + def typedTypeDef(val tdef: dotty.tools.dotc.ast.untpd.TypeDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree + def typedStats( + val stats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , val exprOwner: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] = { + val stats1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + ] + = + dotty.tools.dotc.ast.Trees.flatten[dotty.tools.dotc.core.Types.Type' + ] + (super.typedStats(stats, exprOwner)(ctx)) + if ctx.owner.isClass then { + val $8$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ] + = stats1 + Typer.this.addBridges(stats, stats1)(ctx).:::[ + dotty.tools.dotc.ast.tpd.Tree' + ]($8$) + } else stats1 + } + def addBridges( + val oldStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val newStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase + ) + def traverse( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] = + { + def tailLabel30(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] + = + { + after match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ](member @ _: dotty.tools.dotc.ast.tpd.DefDef, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + => + before match { + case scala.package.Nil => + emittedBridges.toList + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ](oldMember @ _: dotty.tools.dotc.ast.untpd.DefDef, + oldTail @ _ + ): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + => + val oldSymbol: dotty.tools.dotc.core.Symbols.Symbol = + oldMember.symbol(beforeCtx) + val newSymbol: dotty.tools.dotc.core.Symbols.Symbol = + member.symbol(ctx) + assert(oldSymbol.name(beforeCtx).==(newSymbol.name(ctx)), + StringContext.apply([""," bridging with ",""]: String*). + s + ( + [{ + oldSymbol.name(beforeCtx) + },{ + newSymbol.name(ctx) + }]: (oldSymbol.ThisName | newSymbol.ThisName)* + ) + ) + val newOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldSymbol.denot(ctx).allOverriddenSymbols(ctx).toSet[ + dotty.tools.dotc.core.Symbols.Symbol + ] + val oldOverridden: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + dotty.tools.dotc.core.Symbols.toDenot(newSymbol)(ctx). + allOverriddenSymbols + (beforeCtx).toSet[dotty.tools.dotc.core.Symbols.Symbol] + def stillInBaseClass( + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + derivesFrom + (dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner)( + ctx + ) + val neededBridges: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + oldOverridden.--(newOverridden).filter({ + def $anonfun( + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = stillInBaseClass(sym) + closure($anonfun) + }) + val minimalSet: + scala.collection.immutable.Set[ + dotty.tools.dotc.core.Symbols.Symbol + ] + = + Set.apply[dotty.tools.dotc.core.Symbols.Symbol]( + []: Nothing* + ) + neededBridges.foreach[Unit]({ + def $anonfun( + val bridge: dotty.tools.dotc.core.Symbols.Symbol + ): Unit = { + val isRequired: Boolean = + minimalSet.forall({ + def $anonfun( + nxtBridge: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(bridge)( + ctx + ).info(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + nxtBridge + )(ctx).info(ctx) + )(ctx).unary_! + closure($anonfun) + }) + if isRequired then { + val clash: + Option[dotty.tools.dotc.core.Symbols.Symbol] + = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(oldSymbol) + ( + ctx).owner + )(ctx).decls(ctx).lookupAll(bridge.name(ctx))(ctx) + . + find({ + { + def $anonfun( + sym: dotty.tools.dotc.core.Symbols.Symbol + ): Boolean = { + sym.name(ctx).eq(bridge.name(ctx)).&&( + dotty.tools.dotc.core.Symbols.toDenot(sym) + ( + ctx).info(ctx).widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + } + closure($anonfun) + } + }).orElse[dotty.tools.dotc.core.Symbols.Symbol]( + emittedBridges.find({ + def $anonfun( + val stat: dotty.tools.dotc.ast.tpd.DefDef + ): Boolean = + stat.name.==(bridge.name(ctx)).&&( + stat.tpe.widen(ctx).=:=( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).info(ctx).widen(ctx) + )(ctx) + ) + closure($anonfun) + }).map[dotty.tools.dotc.core.Symbols.Symbol]({ + def $anonfun( + val _$2: dotty.tools.dotc.ast.tpd.DefDef + ): dotty.tools.dotc.core.Symbols.Symbol = + _$2.symbol(ctx) + closure($anonfun) + }) + ) + clash match { + case + Some.unapply[ + dotty.tools.dotc.core.Symbols.Symbol + ](cl @ _): + Some[dotty.tools.dotc.core.Symbols.Symbol] + => + ctx.error( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["bridge for method "," of type ","\\n"]: + String* + ) + ).i( + [{ + newSymbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + newSymbol + )(ctx).info(beforeCtx) + }]: + (String | dotty.tools.dotc.core.Types.Type + ) + * + )(ctx).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["clashes with "," of type ","\\n"]: + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(cl + ) + (ctx).symbol.showLocated(beforeCtx) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot( + cl + )(ctx).symbol + )(ctx).info(beforeCtx) + }]: + (String | + dotty.tools.dotc.core.Types.Type + )* + )(ctx) + ).+( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["both have same type after erasure: ", + "" + ]: String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot( + bridge + )(ctx).symbol + )(ctx).info(ctx) + }]: dotty.tools.dotc.core.Types.Type* + )(ctx) + ) + , ctx.error$default$2) + case None => + minimalSet = minimalSet.+(bridge) + } + } else () + } + closure($anonfun) + }) + val bridgeImplementations: + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + minimalSet.map[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.Set[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + ] + ]({ + { + def $anonfun( + sym: dotty.tools.dotc.core.Symbols.Symbol + ): + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + = { + $this.makeBridgeDef(member, sym)(ctx) + } + closure($anonfun) + } + })( + scala.collection.immutable.Set.canBuildFrom[ + dotty.tools.dotc.ast.Trees.DefDef[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + emittedBridges.++=(bridgeImplementations) + tailLabel30($this)(newTail, oldTail, traverse$default$3) + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ](notADefDef @ _, oldTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + => + tailLabel30($this)(after, oldTail, traverse$default$3) + } + case + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ](notADefDef @ _, newTail @ _): + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + => + tailLabel30($this)(newTail, before, traverse$default$3) + } + } + tailLabel30(Typer.this)(after, before, emittedBridges) + } + def traverse$default$3: + scala.collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + = + collection.mutable.ListBuffer.apply[dotty.tools.dotc.ast.tpd.DefDef] + ( + []: Nothing*) + traverse(newStats, oldStats, traverse$default$3) + } + def makeBridgeDef(val newDef: dotty.tools.dotc.ast.tpd.DefDef, + val parentSym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.DefDef + = { + def error(val reason: String): Nothing = { + assert(false, + StringContext.apply( + ["failure creating bridge from "," to ",", reason: ",""]: + String* + ).s( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason]: (dotty.tools.dotc.core.Symbols.Symbol | String)* + ) + ) + ??? + } + val bridge: dotty.tools.dotc.core.Symbols.TermSymbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + val name$5: parentSym.ThisName = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ctx.newSymbol$default$5[parentSym.ThisName'] + ctx.newSymbol[parentSym.ThisName'](owner$3, name$5, flags$1, + info$3 + , privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .coord + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase.prev.asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + )(ctx) + ctx.debuglog( + StringContext.apply(["generating bridge from "," to ",""]: String*). + s + ( + [{ + newDef.symbol(ctx) + },bridge]: dotty.tools.dotc.core.Symbols.Symbol* + ) + ) + val sel: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.This[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .asClass + )(ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + termRef + (ctx) + )(ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx).info(ctx).widen( + ctx + ).resultType + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun( + val paramss: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val rhs: dotty.tools.dotc.ast.tpd.Tree = + paramss.foldLeft[dotty.tools.dotc.ast.tpd.Tree'](sel)({ + def $anonfun(fun: dotty.tools.dotc.ast.tpd.Tree, + vparams: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ): dotty.tools.dotc.ast.tpd.Tree = + fun.tpe.widen(ctx) match { + case + dotty.tools.dotc.core.Types.MethodType(names @ _, + types @ _ + ): dotty.tools.dotc.core.Types.MethodType + => + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + Tuple2.apply[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ](vparams, types) + ).zipped[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + ] + , + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ).map[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + def $anonfun( + _$3: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , _$4: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd.EmptyTree + )(ctx) + closure($anonfun) + })( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + )(ctx) + case a @ _ => + error( + StringContext.apply( + ["can not resolve apply type ",""]: String* + ).s([a]: dotty.tools.dotc.core.Types.Type*) + ) + } + closure($anonfun) + }) + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3)( + ctx + ) + } + closure($anonfun) + } + })(ctx) + } + def adapt(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val original: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + { + val printer$1: + dotty.tools.dotc.config.Printers.Printer @uncheckedVariance + = + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["adapting ",": "," to ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , printer$1, true) + }({ + assert( + ctx.phase.==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase. + next + ) + , ctx.phase) + if tree.isEmpty then tree else + if ctx.mode.is(dotty.tools.dotc.typer.Mode.Pattern) then tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt)( + ctx + ) + }) + } + val Typer: dotty.tools.dotc.transform.Erasure.Typer$ = + new dotty.tools.dotc.transform.Erasure.Typer$() + class Typer$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Typer$.type => + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after TreeTransform:{patternMatcher, explicitOuter, splitter}: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure() extends dotty.tools.dotc.util.DotClass() with + dotty.tools.dotc + .core.Phases.Phase with dotty.tools.dotc.core.DenotTransformers. + DenotTransformer + { thisTransformer: dotty.tools.dotc.transform.Erasure => + def phaseName: String = "erasure" + def runsAfter: + scala.collection.immutable.Set[ + Class[_ <: dotty.tools.dotc.core.Phases.Phase] + ] + = + Set.apply[Class[_ <: dotty.tools.dotc.core.Phases.Phase]']( + [classOf[dotty.tools.dotc.transform.InterceptedMethods], + classOf[dotty.tools.dotc.transform.Splitter] + ,classOf[dotty.tools.dotc.transform.ElimRepeated]]: + Class[_ + >: + dotty.tools.dotc.transform.InterceptedMethods & + dotty.tools.dotc.transform.Splitter + & dotty.tools.dotc.transform.ElimRepeated + <: + dotty.tools.dotc.transform.InterceptedMethods | + dotty.tools.dotc.transform.Splitter + | dotty.tools.dotc.transform.ElimRepeated + ]* + ) + def transform(val ref: dotty.tools.dotc.core.Denotations.SingleDenotation) + ( + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Denotations.SingleDenotation + = { + val selector12: dotty.tools.dotc.core.Denotations.SingleDenotation = ref + { + def case21(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def case31(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def matchFail21(): + dotty.tools.dotc.core.Denotations.SingleDenotation + = throw new MatchError(selector12) + { + val ref: dotty.tools.dotc.core.Denotations.SingleDenotation = + selector12 + { + ref.derivedSingleDenotation(ref.symbol, + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx))( + ctx + ) + )(ctx) + } + } + } + if + selector12.isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ] + then { + val ref: dotty.tools.dotc.core.SymDenotations.SymDenotation = + selector12.asInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation(ref) + ] + { + { + assert(ctx.phase.==(this), + StringContext.apply(["transforming "," at ",""]: String*).s( + [ref,{ + ctx.phase + }]: + (dotty.tools.dotc.core.SymDenotations.SymDenotation | + dotty.tools.dotc.core.Phases.Phase + )* + ) + ) + if + ref.symbol.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + ) + then { + val $1$: + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = { + val selector11: + dotty.tools.dotc.core.Types.Type @unchecked + = + ref.info(ctx): + dotty.tools.dotc.core.Types.Type @unchecked + { + def case11(): + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = { + def matchFail11(): + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = throw new MatchError(selector11) + if + selector11.isInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + then { + val x21: dotty.tools.dotc.core.Types.ClassInfo = + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + { + val o51: + Option[(dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Symbols.ClassSymbol + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + )] + = + dotty.tools.dotc.core.Types.ClassInfo.unapply( + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + ) + if o51.isDefined then { + val x31: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Symbols.ClassSymbol + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = o51.get + { + val pre: dotty.tools.dotc.core.Types.Type = + x31._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = x31._3 + val decls: dotty.tools.dotc.core.Scopes.Scope + = + x31._4 + val selfInfo: dotty.tools.dotc.util.DotClass + = + x31._5 + { + val p41: + dotty.tools.dotc.core.Symbols.ClassSymbol + = x31._2 + Tuple4.apply[ + dotty.tools.dotc.core.Types.Type' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ]' + , dotty.tools.dotc.core.Scopes.Scope', + dotty.tools.dotc.util.DotClass' + ](pre, ps, decls, selfInfo) + } + } + } else matchFail11() + } + } else matchFail11() + } + case11() + } + } + val pre: dotty.tools.dotc.core.Types.Type = $1$._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = $1$._2 + val decls: dotty.tools.dotc.core.Scopes.Scope = $1$._3 + val selfInfo: dotty.tools.dotc.util.DotClass = $1$._4 + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope + = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + )(ctx).classInfo(ctx).decls.foreach[ + dotty.tools.dotc.core.Symbols.Symbol' + ]({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol' + = + extendedScope.enter[ + dotty.tools.dotc.core.Symbols.Symbol' + ](sym)(ctx) + closure($anonfun) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$2 + val name$1: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$1: + dotty.tools.dotc.core.Flags.FlagSet @uncheckedVariance + = ref.copySymDenotation$default$4 + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol + , + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + , ps, extendedScope, selfInfo)(ctx) + )(ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$6 + val annotations$1: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Annotations.Annotation + ] @uncheckedVariance + = ref.copySymDenotation$default$7 + ref.copySymDenotation(symbol$1, owner$1, name$1, + initFlags$1 + , info$1, privateWithin$1, annotations$1)(ctx) + } + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = + ref.owner + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if + oldOwner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ) + then dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + else + oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = + ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol + , + oldInfo)(ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~( + dotty.tools.dotc.core.Flags.HasDefaultParams + ) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass)(ctx). + unary_! + , + StringContext.apply( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""]: String* + ).s( + [ref,{ + ctx.phase + },oldOwner,newOwner,oldInfo,newInfo,{ + oldOwner.eq(newOwner) + },{ + oldInfo.eq(newInfo) + }]: + ( + dotty.tools.dotc.core.SymDenotations.SymDenotation + | + dotty.tools.dotc.core.Phases.Phase | + dotty.tools.dotc.core.Symbols.Symbol + | dotty.tools.dotc.core.Types.Type + | Boolean)* + ) + ) + { + val symbol$2: + dotty.tools.dotc.core.Symbols.Symbol + @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = + newOwner + val name$2: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, + initFlags$2 + , info$2, ref.copySymDenotation$default$6, + ref.copySymDenotation$default$7 + )(ctx) + } + } + } + } + } + } else case31() + } + case21() + } + } + val eraser: dotty.tools.dotc.transform.Erasure.Typer = + new dotty.tools.dotc.transform.Erasure.Typer() + def run(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit + unit.tpdTree_=( + Erasure.this.eraser.typedExpr(unit.tpdTree, + Erasure.this.eraser.typedExpr$default$2 + )(ctx.fresh.setPhase(this.next)) + ) + } + def checkPostCondition(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree)(ctx) + { + val selector13: dotty.tools.dotc.ast.tpd.Tree = tree + { + def case41(): Unit = { + def case51(): Unit = { + def matchFail31(): Unit = throw new MatchError(selector13) + { + { + () + } + } + } + if selector13.isInstanceOf[dotty.tools.dotc.ast.tpd.This] then { + val res: dotty.tools.dotc.ast.tpd.This = + selector13.asInstanceOf[dotty.tools.dotc.ast.tpd.This(res)] + { + { + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + , res)(ctx).unary_! + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["Reference to "," from ",""]: String* + ) + ).i( + [res,{ + ctx.owner.showLocated(ctx) + }]: (dotty.tools.dotc.ast.tpd.This | String)* + )(ctx) + ) + } + } + } else case51() + } + case41() + } + } + } + def assertErased(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt, tree)(ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure. + apply + (tree.symbol(ctx)).unary_! + then Erasure.this.assertErased(tree.typeOpt.widen(ctx), tree)(ctx) + else + () + if ctx.mode.isExpr then { + val selector14: dotty.tools.dotc.core.Types.Type = tree.tpe + { + def case61(): Unit = { + def case71(): Unit = { + def matchFail41(): Unit = throw new MatchError(selector14) + { + { + () + } + } + } + if selector14.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val ref: dotty.tools.dotc.core.Types.TermRef = + selector14.asInstanceOf[ + dotty.tools.dotc.core.Types.TermRef(ref) + ] + { + { + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["non-sym type "," of class "," with denot of class ", + " of " + ,""]: String* + ) + ).i( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree]: + (dotty.tools.dotc.core.Types.TermRef | Class | + dotty.tools.dotc.ast.tpd.Tree + )* + )(ctx) + ) + } + } + } else case71() + } + case61() + } + } else () + } + def assertErased(val tp: dotty.tools.dotc.core.Types.Type, + val tree: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp)(ctx), + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""]: String* + ) + ).i( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe + },{ + tree.getClass() + },{ + ctx.phase + }]: + ( + dotty.tools.dotc.core.Types.Type | String | Class | + dotty.tools.dotc.ast.tpd.Tree + | dotty.tools.dotc.core.Phases.Phase)* + )(ctx) + ) + def assertErased$default$2: dotty.tools.dotc.ast.tpd.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$() extends Object() with dotty.tools.dotc.transform. + TypeTestsCasts + { this: dotty.tools.dotc.transform.Erasure$.type => + val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ = + new dotty.tools.dotc.transform.Erasure.Boxing$() + class Boxing$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Boxing$.type => + + def isUnbox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.unbox).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def isBox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.box).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def boxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.box)(ctx). + symbol + def unboxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.unbox)(ctx) + . + symbol + def safelyRemovableUnboxArg(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = { + val selector15: dotty.tools.dotc.ast.tpd.Tree = tree + { + def case81(): + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + = { + def case91(): + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + = { + def matchFail51(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = throw new MatchError(selector15) + { + { + dotty.tools.dotc.ast.tpd.EmptyTree + } + } + } + if + selector15.isInstanceOf[ + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + then { + val x22: + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + = + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + { + val o101: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + dotty.tools.dotc.ast.Trees.Apply.unapply[ + dotty.tools.dotc.core.Types.Type' + ]( + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + ) + if o101.isDefined then { + val x32: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o101.get + { + val fn: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x32._1 + val p42: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x32._2 + if + p42.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ] + then { + val x51: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + = + p42.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ] + { + val o91: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + p42.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ] + ) + if o91.isDefined then { + val x61: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o91.get + { + val arg: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x61._1 + val p71: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x61._2 + if scala.package.Nil.equals(p71) then { + val x81: + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + = + p71.asInstanceOf[ + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + ] + { + if + dotty.tools.dotc.transform.Erasure.Boxing. + isUnbox + (fn.symbol(ctx))(ctx).&&( + dotty.tools.dotc.core.Symbols.defn(ctx). + ScalaBoxedClasses + .contains( + arg.tpe.widen(ctx).typeSymbol(ctx) + ) + ) + then { + arg + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + case81() + } + } + def constant(val tree: dotty.tools.dotc.ast.tpd.Tree, + val const: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree)(ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.tpd.Tree = tree + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($2$) + }, const)(ctx) + def box(val tree: dotty.tools.dotc.ast.tpd.Tree, val target: => String)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["boxing ",": "," into ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },target]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + { + val selector16: dotty.tools.dotc.core.Types.Type = + tree.tpe.widen(ctx) + { + def case101(): dotty.tools.dotc.ast.tpd.Tree = { + def case111(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail61(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector16) + { + val tp: dotty.tools.dotc.core.Types.Type = selector16 + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant( + tree + , + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx). + BoxedUnit_UNIT + )(ctx) + )(ctx) + else + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx). + NothingClass + ) + then tree else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx). + ArrayClass + ) + ) + val arg: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree)(ctx) + if arg.isEmpty then + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + boxMethod + (cls.asClass)(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + else { + ctx.log( + StringContext.apply( + ["boxing an unbox: "," -> ",""]: String* + ).s( + [{ + tree.symbol(ctx) + },{ + arg.tpe + }]: + (dotty.tools.dotc.core.Symbols.Symbol | + dotty.tools.dotc.core.Types.Type + )* + ) + ) + arg + } + } + } + } + } + if + selector16.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x23: dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o52: + Option[(dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + )] + = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + ) + if o52.isDefined then { + val x33: + (dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + ) + = o52.get + { + val clazz: dotty.tools.dotc.core.Symbols.ClassSymbol + = + x33._1 + { + val p43: dotty.tools.dotc.core.Types.Type = x33._2 + { + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz + ) + (ctx).typeRef(ctx) + , { + val $3$: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing.cast + ( + tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + ( + dotty.tools.dotc.core.Symbols.toClassDenot + ( + clazz)(ctx) + )(ctx) + )(ctx) + scala.package.Nil.::[ + dotty.tools.dotc.ast.tpd.Tree' + ]($3$) + })(ctx) + } + } + } + } else case111() + } + } else case111() + } + case101() + } + } + }) + def box$default$2: String = "" + def unbox(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["unboxing ",": "," as a ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )({ + { + val selector17: dotty.tools.dotc.core.Types.Type = pt + { + def case121(): dotty.tools.dotc.ast.tpd.Tree = { + def case131(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail71(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector17) + { + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant( + tree + , + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply(()) + )(ctx) + )(ctx) + else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass + ) + ) + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + unboxMethod + (cls.asClass)(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + } + } + } + } + if + selector17.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x24: dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o41: + Option[(dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + )] + = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + ) + if o41.isDefined then { + val x34: + (dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + ) + = o41.get + { + val clazz: dotty.tools.dotc.core.Symbols.ClassSymbol + = + x34._1 + val underlying: dotty.tools.dotc.core.Types.Type = + x34._2 + { + { + val tree1: dotty.tools.dotc.ast.tpd.Tree = + if + tree.tpe.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx). + NullClass + )(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (underlying).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, underlying)(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Select[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + dotty.tools.dotc.transform.Erasure.Boxing. + adaptToType + (tree, + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz)(ctx).typeRef(ctx) + )(ctx) + ).select( + dotty.tools.dotc.transform.ValueClasses. + valueClassUnbox + ( + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz)(ctx) + )(ctx) + )(ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree1 + , pt)(ctx) + } + } + } + } else case131() + } + } else case131() + } + case121() + } + } + }) + def cast(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel11( + val $this: dotty.tools.dotc.transform.Erasure.Boxing$.type + )(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass)(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt)(ctx) + else + { + val selector18: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = + Tuple2.apply[dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ](tree.tpe, pt) + { + def case141(): dotty.tools.dotc.ast.tpd.Tree = { + def case151(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail81(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector18) + { + { + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree + ](tree).asInstance(pt)(ctx) + } + } + } + { + val o111: + Option[(dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + )] + = + Tuple2.unapply[dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ](selector18) + if o111.isDefined then { + val x25: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = o111.get + { + val p31: dotty.tools.dotc.core.Types.Type = x25._1 + val p44: dotty.tools.dotc.core.Types.Type = x25._2 + if + p31.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x52: dotty.tools.dotc.core.Types.JavaArrayType = + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o102: Option[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Types.JavaArrayType.unapply( + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + ) + if o102.isDefined then { + val x62: dotty.tools.dotc.core.Types.Type = + o102.get + { + val treeElem: dotty.tools.dotc.core.Types.Type + = + x62 + if + p44.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x71: + dotty.tools.dotc.core.Types.JavaArrayType + = + p44.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o92: + Option[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Types.JavaArrayType. + unapply + ( + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + JavaArrayType + ] + ) + if o92.isDefined then { + val x82: dotty.tools.dotc.core.Types.Type + = + o92.get + { + val ptElem: + dotty.tools.dotc.core.Types.Type + = x82 + { + if + dotty.tools.dotc.transform.TypeUtils + . + decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform. + TypeUtils + .decorateTypeUtils(ptElem). + isPrimitiveValueType + (ctx).unary_! + ) + then { + tailLabel11($this)( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types. + Type + ] + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols. + defn + (ctx).runtimeMethod( + dotty.tools.dotc.core. + StdNames + .nme.toObjectArray + ) + )(ctx) + ).appliedTo(tree)(ctx) + , pt)(ctx) + } else case151() + } + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } + case141() + } + } + } + tailLabel11(Boxing$.this)(tree, pt)(ctx) + } + def adaptToType(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel12( + val $this: dotty.tools.dotc.transform.Erasure.Boxing$.type + )(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else { + val selector19: dotty.tools.dotc.core.Types.Type = + tree.tpe.widen(ctx) + { + def case161(): dotty.tools.dotc.ast.tpd.Tree = { + def case171(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail91(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector19) + { + val tpw: dotty.tools.dotc.core.Types.Type = selector19 + { + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType] + . + ||(tree.tpe.<:<(pt)(ctx)) + then tree else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isErasedValueType(ctx) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree + , + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isErasedValueType(ctx) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt)(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_! + ) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box( + tree + , + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_! + ) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, pt)(ctx) + , pt)(ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast + ( + tree, pt)(ctx) + } + } + } + if + selector19.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x26: dotty.tools.dotc.core.Types.MethodType = + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o71: + Option[( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + )] + = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o71.isDefined then { + val x35: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + ) + = o71.get + { + val p45: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + = x35._1 + if scala.package.Nil.equals(p45) then { + val x63: + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + = + p45.asInstanceOf[ + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + ] + { + val p51: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + = x35._2 + if tree.isTerm then { + tailLabel12($this)( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree + ](tree).appliedToNone(ctx) + , pt)(ctx) + } else case171() + } + } else case171() + } + } else case171() + } + } else case171() + } + case161() + } + } + tailLabel12(Boxing$.this)(tree, pt)(ctx) + } + } + class Typer() extends dotty.tools.dotc.typer.ReTyper() with + dotty.tools.dotc + .typer.NoChecking { + def erasedType(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = { + val selector110: dotty.tools.dotc.core.Types.Type = tree.typeOpt + { + def case181(): dotty.tools.dotc.core.Types.Type = { + def case191(): dotty.tools.dotc.core.Types.Type = { + def matchFail101(): dotty.tools.dotc.core.Types.Type = + throw new MatchError(selector110) + { + val tp: dotty.tools.dotc.core.Types.Type = selector110 + { + dotty.tools.dotc.core.TypeErasure.erasure(tp)(ctx) + } + } + } + if selector110.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val tp: dotty.tools.dotc.core.Types.TermRef = + selector110.asInstanceOf[ + dotty.tools.dotc.core.Types.TermRef(tp) + ] + { + if tree.isTerm then { + dotty.tools.dotc.core.TypeErasure.erasedRef(tp)(ctx) + } else case191() + } + } else case191() + } + case181() + } + } + def promote(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): tree.ThisTree[dotty.tools.dotc.core.Types.Type]#Apply = { + assert(tree.hasType) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree)(ctx) + ctx.log( + StringContext.apply(["promoting ",": ",""]: String*).s( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying(erased.showWithUnderlying$default$1)( + ctx + ) + }]: String* + ) + ) + tree.withType(erased)(ctx) + } + def typedLiteral(val tree: dotty.tools.dotc.ast.untpd.Literal)( + val ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Literal = + if + tree.typeOpt.isRef(dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass + ) + (ctc) + then tree.withType(tree.typeOpt)(ctc) else + super.typedLiteral(tree)(ctc) + def typedSelect(val tree: dotty.tools.dotc.ast.untpd.Select, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).exists, + tree.show(ctx) + ) + def select(val qual: dotty.tools.dotc.ast.tpd.Tree, + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.tpd.Tree = { + val name: sym.ThisName = { + val selector111: dotty.tools.dotc.core.Types.Type = tree.typeOpt + { + def case201(): sym.ThisName = { + def case211(): sym.ThisName = { + def matchFail111(): sym.ThisName = + throw new MatchError(selector111) + { + { + sym.name(ctx) + } + } + } + if + selector111.isInstanceOf[ + dotty.tools.dotc.core.Types.NamedType + ] + then { + val tp: dotty.tools.dotc.core.Types.NamedType = + selector111.asInstanceOf[ + dotty.tools.dotc.core.Types.NamedType(tp) + ] + { + if + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tp.name).isInheritedName + then { + dotty.tools.dotc.core.NameOps.NameDecorator[ + sym.ThisName' + ](sym.name(ctx)).inheritedName + } else case211() + } + } else case211() + } + case201() + } + } + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, sym.name(ctx))(ctx + ) + .withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym(qual.tpe, sym)( + ctx + ) + )(ctx) + } + def selectArrayMember(val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = { + def tailLabel14(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name + ](tree.name).genericArrayOp + , pt, [qual]: dotty.tools.dotc.ast.tpd.Tree*)(ctx) + else + if qual.tpe.<:<(erasedPre)(ctx).unary_! then + tailLabel14($this)( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, + erasedPre + )(ctx) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name + ](tree.name).primitiveArrayOp + )(ctx) + , qual)(ctx) + tailLabel14(Typer.this)(qual, erasedPre) + } + def adaptIfSuper(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val selector113: dotty.tools.dotc.ast.tpd.Tree = qual + { + def case231(): dotty.tools.dotc.ast.tpd.Tree = { + def case241(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail131(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector113) + { + { + qual + } + } + } + if + selector113.isInstanceOf[ + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + ] + then { + val x28: + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + = + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + ] + { + val o61: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , dotty.tools.dotc.core.Names.TypeName)] + = + dotty.tools.dotc.ast.Trees.Super.unapply[ + dotty.tools.dotc.core.Types.Type' + ]( + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + ] + ) + if o61.isDefined then { + val x37: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , dotty.tools.dotc.core.Names.TypeName) + = o61.get + { + val thisQual: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x37._1 + val p46: dotty.tools.dotc.core.Names.TypeName = x37._2 + if + dotty.tools.dotc.core.StdNames.tpnme.EMPTY.equals(p46) + then { + val x53: + => dotty.tools.dotc.core.Names.TypeName( + dotty.tools.dotc + .core.StdNames.tpnme.EMPTY) + = + p46.asInstanceOf[ + => dotty.tools.dotc.core.Names.TypeName( + dotty.tools.dotc + .core.StdNames.tpnme.EMPTY) + ] + { + { + val $4$: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = { + val selector112: + dotty.tools.dotc.core.Types.Type @unchecked + = + qual.tpe: + dotty.tools.dotc.core.Types.Type @unchecked + { + def case221(): + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = { + def matchFail121(): + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = throw new MatchError(selector112) + if + selector112.isInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + then { + val x27: + dotty.tools.dotc.core.Types.SuperType + = + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + { + val o42: + Option[( + dotty.tools.dotc.core.Types.Type + , dotty.tools.dotc.core.Types.Type)] + = + dotty.tools.dotc.core.Types.SuperType. + unapply + ( + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + SuperType + ] + ) + if o42.isDefined then { + val x36: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = o42.get + { + val thisType: + dotty.tools.dotc.core.Types.Type + = x36._1 + val supType: + dotty.tools.dotc.core.Types.Type + = x36._2 + { + Tuple2.apply[ + dotty.tools.dotc.core.Types.Type + ' + , + dotty.tools.dotc.core.Types.Type + ' + ](thisType, supType) + } + } + } else matchFail121() + } + } else matchFail121() + } + case221() + } + } + val thisType: dotty.tools.dotc.core.Types.Type = + $4$._1 + val supType: dotty.tools.dotc.core.Types.Type = + $4$._2 + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx + ) + .owner + )(ctx).is(dotty.tools.dotc.core.Flags.Trait)(ctx + ) + then + dotty.tools.dotc.ast.tpd.cpy.Super(qual)( + thisQual + , + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx + ) + .owner.asClass.name(ctx) + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym) + ( + ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + )(ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , thisType.firstParent(ctx))(ctx) + )(ctx) + } + } + } else case241() + } + } else case241() + } + } else case241() + } + case231() + } + } + def recur(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel16(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe.widen(ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).isConstructor + , + StringContext.apply(["",""]: String*).s( + [{ + sym.showLocated(ctx) + }]: String* + ) + ) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx).info(ctx).decl(sym.name(ctx))(ctx).symbol + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe + ).isErasedValueType(ctx) + ) + then + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2 + )(ctx) + ) + else + if qualIsPrimitive.unary_!.&&(symIsPrimitive) then + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass + ) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier.typeOpt.widen(ctx).finalResultType + )(ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.tpd.Tree = + adaptIfSuper(qual) + if + qual1.tpe.derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.tpd.Super] + ) + then select(qual1, sym) else + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx). + owner + )(ctx).typeRef(ctx) + )(ctx) + ) + } + } + tailLabel16(Typer.this)(qual) + } + recur( + Typer.this.typed(tree.qualifier, + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + )(ctx) + ) + } + def typedSelectFromTypeTree( + val tree: dotty.tools.dotc.ast.untpd.SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.Type)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name).withPos(tree.pos).withType + ( + Typer.this.erasedType(tree)(ctx))(ctx) + def typedThis(val tree: dotty.tools.dotc.ast.untpd.This)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx))(ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree)(ctx) else { + ctx.log( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + ["computing outer path from ","%, % to ",", encl class = ",""] + : + String* + ) + ).i( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + ownersIterator + (ctx).toList + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + }]: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Symbols.Symbol + ] + | dotty.tools.dotc.core.Symbols.Symbol)* + )(ctx) + ) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs(val name: dotty.tools.dotc.core.Names.Name + , + val pt: dotty.tools.dotc.core.Types.Type, + val args: + scala.collection.Seq[dotty.tools.dotc.ast.tpd.Tree] @Repeated + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.TermSymbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: + scala.collection.immutable.List[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Symbols.toDenot(meth)(ctx).info(ctx). + firstParamTypes + .drop(args.length) + val followingArgs: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + ' + ](Typer.this.protoArgs(pt)).zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](followingParams)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }).asInstanceOf[ + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + ] + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + )(ctx) + ).appliedToArgs( + args.toList.++[dotty.tools.dotc.ast.tpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ]' + ](followingArgs)( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ) + )(ctx) + } + def protoArgs(val pt: dotty.tools.dotc.core.Types.Type): + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + = { + val selector114: dotty.tools.dotc.core.Types.Type = pt + { + def case251(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = { + def case261(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = { + def matchFail141(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = throw new MatchError(selector114) + { + { + scala.package.Nil + } + } + } + if + selector114.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto + ] + then { + val pt: dotty.tools.dotc.typer.ProtoTypes.FunProto = + selector114.asInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto(pt) + ] + { + { + pt.args.++[dotty.tools.dotc.ast.untpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]' + ](Typer.this.protoArgs(pt.resultType))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + ) + } + } + } else case261() + } + case251() + } + } + def typedTypeApply(val tree: dotty.tools.dotc.ast.untpd.TypeApply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val ntree: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree.asInstanceOf[dotty.tools.dotc.ast.tpd.TypeApply] + )(ctx) + { + val selector116: dotty.tools.dotc.ast.tpd.Tree = ntree + { + def case291(): dotty.tools.dotc.ast.tpd.Tree = { + def case301(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail161(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector116) + { + { + Typer.this.typedExpr(ntree, pt)(ctx) + } + } + } + if + selector116.isInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + then { + val x29: + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + = + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + { + val o43: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + dotty.tools.dotc.ast.Trees.TypeApply.unapply[ + dotty.tools.dotc.core.Types.Type' + ]( + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + ) + if o43.isDefined then { + val x38: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o43.get + { + val fun: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x38._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x38._2 + { + { + val fun1: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + )(ctx) + { + val selector115: dotty.tools.dotc.core.Types.Type + = + fun1.tpe.widen(ctx) + { + def case271(): dotty.tools.dotc.ast.tpd.Tree = { + def case281(): dotty.tools.dotc.ast.tpd.Tree + = + { + def matchFail151(): + dotty.tools.dotc.ast.tpd.Tree + = throw new MatchError(selector115) + { + { + fun1 + } + } + } + if + selector115.isInstanceOf[ + dotty.tools.dotc.core.Types.PolyType + ] + then { + val funTpe: + dotty.tools.dotc.core.Types.PolyType + = + selector115.asInstanceOf[ + dotty.tools.dotc.core.Types.PolyType( + funTpe + ) + ] + { + { + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + dotty.tools.dotc.core.Decorators. + ListDecorator + [ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](args).mapconserve[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types. + Type + ] + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.typedType(_$1, + Typer.this.typedType$default$2 + )(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.TypeApply + ( + tree)(fun1, args1)(ctx).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd. + ListOfTreeDecorator + (args1).tpes + )(ctx) + )(ctx) + } + } + } else case281() + } + case271() + } + } + } + } + } + } else case301() + } + } else case301() + } + case291() + } + } + } + def typedApply(val tree: dotty.tools.dotc.ast.untpd.Apply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val $5$: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = { + val selector117: dotty.tools.dotc.ast.untpd.Apply @unchecked = + tree: dotty.tools.dotc.ast.untpd.Apply @unchecked + { + def case311(): + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = { + def matchFail171(): + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = throw new MatchError(selector117) + { + val o31: + Option[(dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + )] + = + dotty.tools.dotc.ast.Trees.Apply.unapply[Null'](selector117) + if o31.isDefined then { + val x210: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = o31.get + { + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = x210._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = x210._2 + { + Tuple2.apply[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ]' + ](fun, args) + } + } + } else matchFail171() + } + } + case311() + } + } + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = $5$._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = $5$._2 + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply + ) + then Typer.this.typedUnadapted(args.head, pt)(ctx) else { + val selector119: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this) + ( + ctx) + )(ctx) + { + def case341(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def case351(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def matchFail191(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = throw new MatchError(selector119) + { + val fun1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = selector119 + { + { + val selector118: dotty.tools.dotc.core.Types.Type = + fun1.tpe.widen(ctx) + { + def case321(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def case331(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def matchFail181(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = throw new MatchError(selector118) + { + { + throw + new MatchError( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + ["tree ", + " has unexpected type of function " + ,", was ",""]: String* + ) + ).i( + [tree,{ + fun1.tpe.widen(ctx) + },{ + fun.typeOpt.widen(ctx) + }]: + (dotty.tools.dotc.ast.untpd.Apply | + dotty.tools.dotc.core.Types.Type + )* + )(ctx) + ) + } + } + } + if + selector118.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val mt: dotty.tools.dotc.core.Types.MethodType = + selector118.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType(mt) + ] + { + { + val outers: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = + dotty.tools.dotc.transform.ExplicitOuter. + outer + (ctx).args( + fun.asInstanceOf[ + dotty.tools.dotc.ast.tpd.Tree + ] + ) + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = + { + val $6$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = outers + dotty.tools.dotc.core.Decorators. + ListDecorator + [dotty.tools.dotc.ast.Trees.Tree[Null]']( + args.++[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null + ] + ' + ]' + ](Typer.this.protoArgs(pt))( + scala.collection.immutable.List. + canBuildFrom + [ + dotty.tools.dotc.ast.Trees.Tree[Null + ] + ' + ] + ).:::[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]($6$) + ) + }.zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](mt.paramTypes)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[Null] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[Null] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.Apply(tree)( + fun1 + , args1)(ctx).withType(mt.resultType)(ctx) + } + } + } else case331() + } + case321() + } + } + } + } + } + if selector119.isInstanceOf[dotty.tools.dotc.ast.tpd.Apply] then + + { + val fun1: dotty.tools.dotc.ast.tpd.Apply = + selector119.asInstanceOf[ + dotty.tools.dotc.ast.tpd.Apply(fun1) + ] + { + { + fun1 + } + } + } + else case351() + } + case341() + } + } + } + def typedSeqLiteral(val tree: dotty.tools.dotc.ast.untpd.SeqLiteral, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.SeqLiteral + = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt)(ctx) + )(ctx) + def typedValDef(val vdef: dotty.tools.dotc.ast.untpd.ValDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2)(ctx).withPos( + vdef.tpt.pos + ) + ) + val rhs$1: dotty.tools.dotc.ast.untpd.Tree = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy.ValDef(vdef)(name$3, tpt$1, rhs$1) + }, sym)(ctx) + def typedDefDef(val ddef: dotty.tools.dotc.ast.untpd.DefDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef[dotty.tools.dotc.core.Types.Type] + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx).resultType + val ddef1: dotty.tools.dotc.ast.untpd.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.DefDef$default$2(ddef) + val vparamss$1: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + ] + = { + val $7$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = + ddef.vparamss.flatten[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ] + ) + scala.package.Nil.::[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ]($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2 + )(ctx).withPos(ddef.tpt.pos) + ) + val rhs$2: + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + = { + val selector120: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = ddef.rhs + { + def case361(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = { + def case371(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = { + def matchFail201(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = throw new MatchError(selector120) + { + { + ddef.rhs + } + } + } + if + selector120.isInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + ] + then { + val x211: + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + ] + { + val o62: Option[dotty.tools.dotc.core.Names.Name] = + dotty.tools.dotc.ast.Trees.Ident.unapply[ + dotty.tools.dotc.ast.Trees.Untyped' + ]( + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + ] + ) + if o62.isDefined then { + val x39: dotty.tools.dotc.core.Names.Name = o62.get + { + val p47: dotty.tools.dotc.core.Names.Name = x39 + if + dotty.tools.dotc.core.StdNames.nme.WILDCARD.equals( + p47 + ) + then { + val x54: + => dotty.tools.dotc.core.Names.TermName( + dotty.tools.dotc + .core.StdNames.nme.WILDCARD) + = + p47.asInstanceOf[ + => dotty.tools.dotc.core.Names.TermName( + dotty.tools.dotc + .core.StdNames.nme.WILDCARD) + ] + { + val id: + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + { + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe)(ctx) + ) + } + } + } else case371() + } + } else case371() + } + } else case371() + } + case361() + } + } + dotty.tools.dotc.ast.untpd.cpy.DefDef(ddef)(name$4, + scala.package.Nil + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym)(ctx) + } + def typedTypeDef(val tdef: dotty.tools.dotc.ast.untpd.TypeDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree + def typedStats( + val stats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , val exprOwner: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] = { + val stats1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + ] + = + dotty.tools.dotc.ast.Trees.flatten[dotty.tools.dotc.core.Types.Type' + ] + (super.typedStats(stats, exprOwner)(ctx)) + if ctx.owner.isClass then { + val $8$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ] + = stats1 + Typer.this.addBridges(stats, stats1)(ctx).:::[ + dotty.tools.dotc.ast.tpd.Tree' + ]($8$) + } else stats1 + } + def addBridges( + val oldStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val newStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase + ) + def traverse( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] = + { + def tailLabel30(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] + = + { + { + val selector123: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = after + { + def case431(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case441(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case451(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def matchFail231(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = throw new MatchError(selector123) + if + selector123.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + then { + val x65: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + { + val o82: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + ) + if o82.isDefined then { + val x73: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o82.get + { + val newTail: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x73._2 + { + { + tailLabel30($this)(newTail, before, + traverse$default$3 + ) + } + } + } + } else matchFail231() + } + } else matchFail231() + } + if + selector123.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + then { + val x312: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + { + val o94: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + ) + if o94.isDefined then { + val x43: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o94.get + { + val pi52: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x43._1 + val newTail: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x43._2 + if + pi52.isInstanceOf[ + dotty.tools.dotc.ast.tpd.DefDef + ] + then { + val member: dotty.tools.dotc.ast.tpd.DefDef = + pi52.asInstanceOf[ + dotty.tools.dotc.ast.tpd.DefDef(member) + ] + { + { + { + val selector122: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.untpd.Tree + ] + = before + { + def case401(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case411(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case421(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def matchFail221(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd. + DefDef + ] + = + throw + new MatchError(selector122) + if + selector122.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ] + ] + then { + val x64: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ] + = + selector122.asInstanceOf[ + scala.collection.immutable. + :: + [ + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + ] + { + val o81: + Option[( + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + , + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ]( + selector122.asInstanceOf[ + scala.collection.immutable + . + ::[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast + . + Trees.Untyped + ] + ] + ] + ) + if o81.isDefined then { + val x72: + ( + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + , + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast + . + Trees.Untyped + ] + ] + ) + = o81.get + { + val oldTail: + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast + . + Trees.Untyped + ] + ] + = x72._2 + { + { + tailLabel30($this)( + after + , oldTail, + traverse$default$3 + ) + } + } + } + } else matchFail221() + } + } else matchFail221() + } + if + selector122.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees. + Untyped + ] + ] + ] + then { + val x311: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees. + Untyped + ] + ] + = + selector122.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ] + ] + { + val o93: + Option[( + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + , + scala.collection.immutable. + List + [ + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ]( + selector122.asInstanceOf[ + scala.collection.immutable + . + ::[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + ] + ) + if o93.isDefined then { + val x42: + ( + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + , + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + ) + = o93.get + { + val pi51: + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + = x42._1 + val oldTail: + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + = x42._2 + if + pi51.isInstanceOf[ + dotty.tools.dotc.ast. + untpd + .DefDef + ] + then { + val oldMember: + dotty.tools.dotc.ast. + untpd + .DefDef + = + pi51.asInstanceOf[ + dotty.tools.dotc.ast. + untpd + .DefDef(oldMember) + ] + { + { + val oldSymbol: + dotty.tools.dotc.core + . + Symbols.Symbol + = + oldMember.symbol( + beforeCtx + ) + val newSymbol: + dotty.tools.dotc.core + . + Symbols.Symbol + = member.symbol(ctx) + assert( + oldSymbol.name( + beforeCtx + ).==( + newSymbol.name(ctx + ) + ) + , + StringContext.apply( + ["", + " bridging with " + ,""]: String* + ).s( + [{ + oldSymbol.name( + beforeCtx + ) + },{ + newSymbol.name( + ctx + ) + }]: + ( + oldSymbol. + ThisName + | + newSymbol. + ThisName + )* + ) + ) + val newOverridden: + scala.collection.immutable + . + Set[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + = + oldSymbol.denot(ctx) + . + allOverriddenSymbols + ( + ctx).toSet[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + val oldOverridden: + scala.collection.immutable + . + Set[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + = + dotty.tools.dotc. + core + .Symbols.toDenot( + newSymbol + )(ctx). + allOverriddenSymbols + (beforeCtx).toSet[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + def stillInBaseClass( + val sym: + dotty.tools.dotc. + core + .Symbols.Symbol + ): Boolean = + dotty.tools.dotc. + core + .Symbols.toDenot( + ctx.owner + )(ctx).derivesFrom( + dotty.tools.dotc. + core + .Symbols.toDenot( + sym + )(ctx).owner + )(ctx) + val neededBridges: + scala.collection.immutable + . + Set[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + = + oldOverridden.--( + newOverridden + ).filter({ + def $anonfun( + val sym: + dotty.tools.dotc.core + . + Symbols.Symbol + ): Boolean = + stillInBaseClass + ( + sym) + closure($anonfun) + }) + val minimalSet: + scala.collection.immutable + . + Set[ + dotty.tools.dotc. + core + .Symbols.Symbol + ] + = + Set.apply[ + dotty.tools.dotc. + core + .Symbols.Symbol + ]([]: Nothing*) + neededBridges.foreach[ + Unit + ]({ + def $anonfun( + val bridge: + dotty.tools.dotc.core + . + Symbols.Symbol + ): Unit = { + val isRequired: + Boolean + = + minimalSet. + forall + ({ + def $anonfun( + nxtBridge: + dotty.tools.dotc + . + core. + Symbols + .Symbol + ): Boolean = + dotty.tools.dotc + . + core.Symbols + . + toDenot( + bridge + )(ctx).info( + ctx + ).=:=( + dotty.tools.dotc + . + core. + Symbols + .toDenot( + nxtBridge + )(ctx). + info + (ctx) + )(ctx). + unary_! + closure( + $anonfun + ) + }) + if isRequired then + + { + val clash: + Option[ + dotty.tools.dotc + . + core.Symbols + . + Symbol + ] + = + dotty.tools.dotc + . + core.Symbols. + toDenot + ( + dotty.tools.dotc + . + core.Symbols + . + toDenot( + oldSymbol + )(ctx).owner + )(ctx).decls( + ctx + ).lookupAll( + bridge.name( + ctx + ) + )(ctx).find({ + { + def + $anonfun + ( + sym: + dotty.tools.dotc.core + . + Symbols + . + Symbol + ): Boolean + = + { + sym.name + ( + ctx).eq( + bridge + . + name( + ctx + ) + ).&&( + dotty.tools.dotc + . + core. + Symbols + . + toDenot + (sym)( + ctx + ).info + ( + ctx). + widen + (ctx). + =:= + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + ) + (ctx + ) + . + info + ( + ctx) + . + widen + ( + ctx) + )(ctx) + ) + } + closure( + $anonfun + ) + } + }).orElse[ + dotty.tools.dotc.core + . + Symbols. + Symbol + ]( + emittedBridges + . + find({ + def + $anonfun + ( + val stat + : + dotty. + tools + .dotc. + ast + .tpd. + DefDef + ): Boolean + = + stat.name. + == + ( + bridge. + name + (ctx) + ).&&( + stat.tpe + . + widen( + ctx + ).=:=( + dotty.tools.dotc + . + core. + Symbols + . + toDenot + ( + bridge + )(ctx) + . + info( + ctx + ). + widen + (ctx) + )(ctx) + ) + closure( + $anonfun + ) + }).map[ + dotty.tools.dotc.core + . + Symbols. + Symbol + ]({ + def + $anonfun + ( + val _$2 + : + dotty. + tools + .dotc. + ast + .tpd. + DefDef + ): + dotty.tools.dotc.core + . + Symbols. + Symbol + = + _$2. + symbol + (ctx) + closure( + $anonfun + ) + }) + ) + { + val + selector121 + : + Option[ + dotty.tools.dotc + . + core. + Symbols + .Symbol + ] + = clash + { + def case381( + ) + : Unit = { + def + case391 + (): Unit + = + { + def + matchFail211 + (): Unit + = + throw + new + MatchError + ( + selector121 + ) + if + None. + equals + ( + selector121 + ) + then { + val + x41 + : + None$ + .type + = + selector121 + . + asInstanceOf + [ + None$ + .type + ] + { + { + minimalSet + = + minimalSet + . + +( + bridge + ) + } + } + } else + matchFail211 + ( + ) + } + if + selector121 + . + isInstanceOf + [ + Some[ + dotty.tools.dotc + . + core. + Symbols + . + Symbol + ] + ] + then { + val x212 + : + Some[ + dotty.tools.dotc + . + core. + Symbols + . + Symbol + ] + = + selector121 + . + asInstanceOf + [ + Some[ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ] + ] + { + val + o53 + : + Option + [ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ] + = + Some. + unapply + [ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ]( + selector121 + . + asInstanceOf + [ + Some + [ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ] + ] + ) + if + o53. + isDefined + then + { + val + x310 + : + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + = + o53. + get + { + val + + cl + : + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + = + x310 + { + { + ctx + . + error + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + [ + "bridge for method " + , + " of type " + , + "\\n" + ] + : + String + * + ) + ) + . + i + ( + [ + { + newSymbol + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + newSymbol + ) + ( + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + : + ( + String + | + dotty.tools.dotc.core + . + Types + . + Type + ) + * + ) + ( + ctx + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + [ + "clashes with " + , + " of type " + , + "\\n" + ] + : + String + * + ) + ) + . + i + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + ) + ( + ctx + ) + . + symbol + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + ) + ( + ctx + ) + . + symbol + ) + ( + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + : + ( + String + | + dotty.tools.dotc.core + . + Types + . + Type + ) + * + ) + ( + ctx + ) + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + [ + "both have same type after erasure: " + , + "" + ] + : + String + * + ) + ) + . + i + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + ) + ( + ctx + ) + . + symbol + ) + ( + ctx + ) + . + info + ( + ctx + ) + } + ] + : + dotty.tools.dotc.core + . + Types + . + Type + * + ) + ( + ctx + ) + ) + , + ctx + . + error$default$2 + ) + } + } + } + } + else + case391 + ( + ) + } + } else + case391( + ) + } + case381() + } + } + } + else () + } + closure($anonfun) + }) + val + bridgeImplementations + : + scala.collection.immutable + . + Set[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + ] + = + minimalSet.map[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + , + scala.collection.immutable + . + Set[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + ] + ]({ + { + def $anonfun( + sym: + dotty.tools.dotc + . + core.Symbols + . + Symbol + ): + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + = { + $this. + makeBridgeDef + (member, sym)( + ctx + ) + } + closure($anonfun + ) + } + })( + scala.collection.immutable + . + Set.canBuildFrom[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + ] + ) + emittedBridges.++=( + bridgeImplementations + ) + tailLabel30($this)( + newTail + , oldTail, + traverse$default$3 + ) + } + } + } else case421() + } + } else case421() + } + } else case421() + } + if + scala.package.Nil.equals(selector122 + ) + then { + val x213: + => + scala.collection.immutable.Nil$ + .type + (scala.package.Nil) + = + selector122.asInstanceOf[ + => + scala.collection.immutable. + Nil$ + .type + (scala.package.Nil) + ] + { + { + emittedBridges.toList + } + } + } else case411() + } + case401() + } + } + } + } + } else case451() + } + } else case451() + } + } else case451() + } + if scala.package.Nil.equals(selector123) then { + val x214: + => scala.collection.immutable.Nil$.type(scala.package. + Nil + ) + = + selector123.asInstanceOf[ + => scala.collection.immutable.Nil$.type(scala.package. + Nil + ) + ] + { + { + emittedBridges.toList + } + } + } else case441() + } + case431() + } + } + } + tailLabel30(Typer.this)(after, before, emittedBridges) + } + def traverse$default$3: + scala.collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + = + collection.mutable.ListBuffer.apply[dotty.tools.dotc.ast.tpd.DefDef] + ( + []: Nothing*) + traverse(newStats, oldStats, traverse$default$3) + } + def makeBridgeDef(val newDef: dotty.tools.dotc.ast.tpd.DefDef, + val parentSym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.DefDef + = { + def error(val reason: String): Nothing = { + assert(false, + StringContext.apply( + ["failure creating bridge from "," to ",", reason: ",""]: + String* + ).s( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason]: (dotty.tools.dotc.core.Symbols.Symbol | String)* + ) + ) + ??? + } + val bridge: dotty.tools.dotc.core.Symbols.TermSymbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + val name$5: parentSym.ThisName = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ctx.newSymbol$default$5[parentSym.ThisName'] + ctx.newSymbol[parentSym.ThisName'](owner$3, name$5, flags$1, + info$3 + , privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .coord + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase.prev.asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + )(ctx) + ctx.debuglog( + StringContext.apply(["generating bridge from "," to ",""]: String*). + s + ( + [{ + newDef.symbol(ctx) + },bridge]: dotty.tools.dotc.core.Symbols.Symbol* + ) + ) + val sel: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.This[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .asClass + )(ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + termRef + (ctx) + )(ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx).info(ctx).widen( + ctx + ).resultType + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun( + val paramss: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val rhs: dotty.tools.dotc.ast.tpd.Tree = + paramss.foldLeft[dotty.tools.dotc.ast.tpd.Tree'](sel)({ + def $anonfun(fun: dotty.tools.dotc.ast.tpd.Tree, + vparams: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val selector124: dotty.tools.dotc.core.Types.Type = + fun.tpe.widen(ctx) + { + def case461(): dotty.tools.dotc.ast.tpd.Apply = { + def case471(): dotty.tools.dotc.ast.tpd.Apply = { + def matchFail241(): dotty.tools.dotc.ast.tpd.Apply + = + throw new MatchError(selector124) + { + val a: dotty.tools.dotc.core.Types.Type = + selector124 + { + error( + StringContext.apply( + ["can not resolve apply type ",""]: String* + ).s([a]: dotty.tools.dotc.core.Types.Type*) + ) + } + } + } + if + selector124.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x215: dotty.tools.dotc.core.Types.MethodType = + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o44: + Option[( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + )] + = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o44.isDefined then { + val x313: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + ) + = o44.get + { + val types: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + = x313._2 + { + { + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + Tuple2.apply[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ](vparams, types) + ).zipped[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + ] + , + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ).map[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + def $anonfun( + _$3: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + _$4: + dotty.tools.dotc.core.Types.Type + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd. + EmptyTree + )(ctx) + closure($anonfun) + })( + scala.collection.immutable.List. + canBuildFrom + [ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + )(ctx) + } + } + } + } else case471() + } + } else case471() + } + case461() + } + } + closure($anonfun) + }) + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3)( + ctx + ) + } + closure($anonfun) + } + })(ctx) + } + def adapt(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val original: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = { + val printer$1: + dotty.tools.dotc.config.Printers.Printer @uncheckedVariance + = + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply(["adapting ",": "," to ",""]: String*) + ).i( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt]: (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + , printer$1, true)({ + assert( + ctx.phase.==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase. + next + ) + , ctx.phase) + if tree.isEmpty then tree else + if ctx.mode.is(dotty.tools.dotc.typer.Mode.Pattern) then tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt)( + ctx + ) + }) + } + } + val Typer: dotty.tools.dotc.transform.Erasure.Typer$ = + new dotty.tools.dotc.transform.Erasure.Typer$() + class Typer$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Typer$.type => + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after TreeTransform:{elimByName, seqLiterals, intercepted, literalize, getters, resolveSuper}: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure() extends dotty.tools.dotc.util.DotClass() with + dotty.tools.dotc + .core.Phases.Phase with dotty.tools.dotc.core.DenotTransformers. + DenotTransformer + { thisTransformer: dotty.tools.dotc.transform.Erasure => + def toString(): String = Erasure.super[Phase].toString() + def phaseName: String = "erasure" + def runsAfter: + scala.collection.immutable.Set[ + Class[_ <: dotty.tools.dotc.core.Phases.Phase] + ] + = + Set.apply[Class[_ <: dotty.tools.dotc.core.Phases.Phase]']( + Predef.wrapRefArray[ + Class[_ + >: + dotty.tools.dotc.transform.InterceptedMethods & + dotty.tools.dotc.transform.Splitter + & dotty.tools.dotc.transform.ElimRepeated + <: + dotty.tools.dotc.transform.InterceptedMethods | + dotty.tools.dotc.transform.Splitter + | dotty.tools.dotc.transform.ElimRepeated + ] + ]( + [classOf[dotty.tools.dotc.transform.InterceptedMethods], + classOf[dotty.tools.dotc.transform.Splitter] + ,classOf[dotty.tools.dotc.transform.ElimRepeated]] + ): + Class[_ + >: + dotty.tools.dotc.transform.InterceptedMethods & + dotty.tools.dotc.transform.Splitter + & dotty.tools.dotc.transform.ElimRepeated + <: + dotty.tools.dotc.transform.InterceptedMethods | + dotty.tools.dotc.transform.Splitter + | dotty.tools.dotc.transform.ElimRepeated + ]* + ) + def transform(val ref: dotty.tools.dotc.core.Denotations.SingleDenotation) + ( + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Denotations.SingleDenotation + = { + val selector12: dotty.tools.dotc.core.Denotations.SingleDenotation = ref + { + def case21(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def case31(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def matchFail21(): + dotty.tools.dotc.core.Denotations.SingleDenotation + = throw new MatchError(selector12) + { + val ref: dotty.tools.dotc.core.Denotations.SingleDenotation = + selector12 + { + ref.derivedSingleDenotation(ref.symbol, + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx))( + ctx + ) + )(ctx) + } + } + } + if + selector12.isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ] + then { + val ref: dotty.tools.dotc.core.SymDenotations.SymDenotation = + selector12.asInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation(ref) + ] + { + { + assert(ctx.phase.==(this), + [String]({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray[String]( + ["transforming "," at ",""] + ): String* + ).s( + Predef.wrapRefArray[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + | + dotty.tools.dotc.core.Phases.Phase + ]( + [ref,{ + ctx.phase + }] + ): + (dotty.tools.dotc.core.SymDenotations.SymDenotation + | + dotty.tools.dotc.core.Phases.Phase)* + ) + closure($anonfun) + }) + ) + if + ref.symbol.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + ) + then { + val $1$: + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = { + val selector11: + dotty.tools.dotc.core.Types.Type @unchecked + = + ref.info(ctx): + dotty.tools.dotc.core.Types.Type @unchecked + { + def case11(): + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = { + def matchFail11(): + (dotty.tools.dotc.core.Types.Type, + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = throw new MatchError(selector11) + if + selector11.isInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + then { + val x21: dotty.tools.dotc.core.Types.ClassInfo = + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + { + val o51: + Option[(dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Symbols.ClassSymbol + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + )] + = + dotty.tools.dotc.core.Types.ClassInfo.unapply( + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + ) + if o51.isDefined then { + val x31: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Symbols.ClassSymbol + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + , dotty.tools.dotc.core.Scopes.Scope, + dotty.tools.dotc.util.DotClass + ) + = o51.get + { + val pre: dotty.tools.dotc.core.Types.Type = + x31._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = x31._3 + val decls: dotty.tools.dotc.core.Scopes.Scope + = + x31._4 + val selfInfo: dotty.tools.dotc.util.DotClass + = + x31._5 + { + val p41: + dotty.tools.dotc.core.Symbols.ClassSymbol + = x31._2 + Tuple4.apply[ + dotty.tools.dotc.core.Types.Type' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ]' + , dotty.tools.dotc.core.Scopes.Scope', + dotty.tools.dotc.util.DotClass' + ](pre, ps, decls, selfInfo) + } + } + } else matchFail11() + } + } else matchFail11() + } + case11() + } + } + val pre: dotty.tools.dotc.core.Types.Type = $1$._1 + val ps: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.TypeRef + ] + = $1$._2 + val decls: dotty.tools.dotc.core.Scopes.Scope = $1$._3 + val selfInfo: dotty.tools.dotc.util.DotClass = $1$._4 + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope + = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + )(ctx).classInfo(ctx).decls.foreach[ + dotty.tools.dotc.core.Symbols.Symbol' + ]({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol' + = + extendedScope.enter[ + dotty.tools.dotc.core.Symbols.Symbol' + ](sym)(ctx) + closure($anonfun) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$2 + val name$1: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$1: + dotty.tools.dotc.core.Flags.FlagSet @uncheckedVariance + = ref.copySymDenotation$default$4 + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol + , + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + , ps, extendedScope, selfInfo)(ctx) + )(ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ref.copySymDenotation$default$6 + val annotations$1: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Annotations.Annotation + ] @uncheckedVariance + = ref.copySymDenotation$default$7 + ref.copySymDenotation(symbol$1, owner$1, name$1, + initFlags$1 + , info$1, privateWithin$1, annotations$1)(ctx) + } + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = + ref.owner + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if + oldOwner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ) + then dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + else + oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = + ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo(ref.symbol + , + oldInfo)(ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~( + dotty.tools.dotc.core.Flags.HasDefaultParams + ) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass)(ctx). + unary_! + , + [String]({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray[String]( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""] + ): String* + ).s( + Predef.genericWrapArray[ + dotty.tools.dotc.core.SymDenotations. + SymDenotation + | dotty.tools.dotc.core.Phases.Phase | + dotty.tools.dotc.core.Symbols.Symbol + | dotty.tools.dotc.core.Types.Type | Boolean + ]( + [ref,{ + ctx.phase + },oldOwner,newOwner,oldInfo,newInfo,{ + oldOwner.eq(newOwner) + },{ + oldInfo.eq(newInfo) + }] + ): + ( + dotty.tools.dotc.core.SymDenotations. + SymDenotation + | dotty.tools.dotc.core.Phases.Phase | + dotty.tools.dotc.core.Symbols.Symbol + | dotty.tools.dotc.core.Types.Type + | Boolean)* + ) + closure($anonfun) + }) + ) + { + val symbol$2: + dotty.tools.dotc.core.Symbols.Symbol + @uncheckedVariance + = ref.copySymDenotation$default$1 + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = + newOwner + val name$2: + dotty.tools.dotc.core.Names.Name @uncheckedVariance + = ref.copySymDenotation$default$3 + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, + initFlags$2 + , info$2, ref.copySymDenotation$default$6, + ref.copySymDenotation$default$7 + )(ctx) + } + } + } + } + } + } else case31() + } + case21() + } + } + def eraser: dotty.tools.dotc.transform.Erasure.Typer = + new dotty.tools.dotc.transform.Erasure.Typer() + def run(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit + unit.tpdTree_=( + Erasure.this.eraser.typedExpr(unit.tpdTree, + Erasure.this.eraser.typedExpr$default$2 + )(ctx.fresh.setPhase(this.next)) + ) + } + def checkPostCondition(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree)(ctx) + { + val selector13: dotty.tools.dotc.ast.tpd.Tree = tree + { + def case41(): Unit = { + def case51(): Unit = { + def matchFail31(): Unit = throw new MatchError(selector13) + { + { + () + } + } + } + if selector13.isInstanceOf[dotty.tools.dotc.ast.tpd.This] then { + val res: dotty.tools.dotc.ast.tpd.This = + selector13.asInstanceOf[dotty.tools.dotc.ast.tpd.This(res)] + { + { + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + , res)(ctx).unary_! + , + [String]({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray[String]( + ["Reference to "," from ",""] + ): String* + ) + ).i( + Predef.wrapRefArray[ + dotty.tools.dotc.ast.tpd.This | String + ]( + [res,{ + ctx.owner.showLocated(ctx) + }] + ): (dotty.tools.dotc.ast.tpd.This | String)* + )(ctx) + closure($anonfun) + }) + ) + } + } + } else case51() + } + case41() + } + } + } + def assertErased(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt, tree)(ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure. + apply + (tree.symbol(ctx)).unary_! + then Erasure.this.assertErased(tree.typeOpt.widen(ctx), tree)(ctx) + else + () + if ctx.mode.isExpr then { + val selector14: dotty.tools.dotc.core.Types.Type = tree.tpe + { + def case61(): Unit = { + def case71(): Unit = { + def matchFail41(): Unit = throw new MatchError(selector14) + { + { + () + } + } + } + if selector14.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val ref: dotty.tools.dotc.core.Types.TermRef = + selector14.asInstanceOf[ + dotty.tools.dotc.core.Types.TermRef(ref) + ] + { + { + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , + [String]({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray[String]( + ["non-sym type "," of class ", + " with denot of class " + ," of ",""] + ): String* + ) + ).i( + Predef.wrapRefArray[ + dotty.tools.dotc.core.Types.TermRef | Class | + dotty.tools.dotc.ast.tpd.Tree + ]( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree] + ): + (dotty.tools.dotc.core.Types.TermRef | Class | + dotty.tools.dotc.ast.tpd.Tree + )* + )(ctx) + closure($anonfun) + }) + ) + } + } + } else case71() + } + case61() + } + } else () + } + def assertErased(val tp: dotty.tools.dotc.core.Types.Type, + val tree: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp)(ctx), + [String]({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray[String]( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""] + ): String* + ) + ).i( + Predef.wrapRefArray[ + dotty.tools.dotc.core.Types.Type | String | Class | + dotty.tools.dotc.ast.tpd.Tree + | dotty.tools.dotc.core.Phases.Phase + ]( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe + },{ + tree.getClass() + },{ + ctx.phase + }] + ): + ( + dotty.tools.dotc.core.Types.Type | String | Class | + dotty.tools.dotc.ast.tpd.Tree + | dotty.tools.dotc.core.Phases.Phase)* + )(ctx) + closure($anonfun) + }) + ) + def assertErased$default$2: dotty.tools.dotc.ast.tpd.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$() extends Object() with dotty.tools.dotc.transform. + TypeTestsCasts + { this: dotty.tools.dotc.transform.Erasure$.type => + val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ = + new dotty.tools.dotc.transform.Erasure.Boxing$() + class Boxing$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Boxing$.type => + + def isUnbox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.unbox).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def isBox(val sym: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme.box).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses.contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).linkedClass(ctx) + ) + ) + def boxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.box)(ctx). + symbol + def unboxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls)(ctx).linkedClass(ctx + ) + )(ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme.unbox)(ctx) + . + symbol + def safelyRemovableUnboxArg(val tree: dotty.tools.dotc.ast.tpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = { + val selector15: dotty.tools.dotc.ast.tpd.Tree = tree + { + def case81(): + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + = { + def case91(): + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + = { + def matchFail51(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = throw new MatchError(selector15) + { + { + dotty.tools.dotc.ast.tpd.EmptyTree + } + } + } + if + selector15.isInstanceOf[ + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + then { + val x22: + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + = + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + { + val o101: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + dotty.tools.dotc.ast.Trees.Apply.unapply[ + dotty.tools.dotc.core.Types.Type' + ]( + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + ) + if o101.isDefined then { + val x32: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o101.get + { + val fn: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x32._1 + val p42: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x32._2 + if + p42.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ] + then { + val x51: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + = + p42.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ] + { + val o91: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + p42.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ] + ) + if o91.isDefined then { + val x61: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o91.get + { + val arg: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x61._1 + val p71: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x61._2 + if scala.package.Nil.equals(p71) then { + val x81: + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + = + p71.asInstanceOf[ + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + ] + { + if + dotty.tools.dotc.transform.Erasure.Boxing. + isUnbox + (fn.symbol(ctx))(ctx).&&( + dotty.tools.dotc.core.Symbols.defn(ctx). + ScalaBoxedClasses + .contains( + arg.tpe.widen(ctx).typeSymbol(ctx) + ) + ) + then { + arg + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + case81() + } + } + def constant(val tree: dotty.tools.dotc.ast.tpd.Tree, + val const: dotty.tools.dotc.ast.tpd.Tree + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree)(ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.tpd.Tree = tree + scala.package.Nil.::[dotty.tools.dotc.ast.tpd.Tree']($2$) + }, const)(ctx) + def box(val tree: dotty.tools.dotc.ast.tpd.Tree, + val target: () => String + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + [String]({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray[String](["boxing ",": "," into ",""]): + String* + ) + ).i( + Predef.wrapRefArray[String | dotty.tools.dotc.core.Types.Type] + ( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },target.apply()] + ): (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + closure($anonfun) + }) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )( + [dotty.tools.dotc.ast.tpd.Tree]({ + def $anonfun(): dotty.tools.dotc.ast.tpd.Tree = { + { + val selector16: dotty.tools.dotc.core.Types.Type = + tree.tpe.widen(ctx) + { + def case101(): dotty.tools.dotc.ast.tpd.Tree = { + def case111(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail61(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector16) + { + val tp: dotty.tools.dotc.core.Types.Type = selector16 + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx). + UnitClass + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant + ( + tree, + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx). + BoxedUnit_UNIT + )(ctx) + )(ctx) + else + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx). + NothingClass + ) + then tree else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx). + ArrayClass + ) + ) + val arg: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree)(ctx) + if arg.isEmpty then + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + boxMethod + (cls.asClass)(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + else { + ctx.log( + [String]({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray[String]( + ["boxing an unbox: "," -> ",""] + ): String* + ).s( + Predef.wrapRefArray[ + dotty.tools.dotc.core.Symbols.Symbol + | + dotty.tools.dotc.core.Types.Type + ]( + [{ + tree.symbol(ctx) + },{ + arg.tpe + }] + ): + ( + dotty.tools.dotc.core.Symbols. + Symbol + | dotty.tools.dotc.core.Types.Type) + * + ) + closure($anonfun) + }) + ) + arg + } + } + } + } + } + if + selector16.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x23: + dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o52: + Option[(dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + )] + = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + ErasedValueType + ] + ) + if o52.isDefined then { + val x33: + (dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + ) + = o52.get + { + val clazz: + dotty.tools.dotc.core.Symbols.ClassSymbol + = x33._1 + { + val p43: dotty.tools.dotc.core.Types.Type = + x33._2 + { + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + )(ctx).typeRef(ctx) + , { + val $3$: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + cast + (tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + ( + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz)(ctx) + )(ctx) + )(ctx) + scala.package.Nil.::[ + dotty.tools.dotc.ast.tpd.Tree + ]($3$) + })(ctx) + } + } + } + } else case111() + } + } else case111() + } + case101() + } + } + } + closure($anonfun) + }) + ) + def box$default$2: String = "" + def unbox(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + [String]({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray[String](["unboxing ",": "," as a ",""]) + : + String* + ) + ).i( + Predef.wrapRefArray[String | dotty.tools.dotc.core.Types.Type] + ( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt] + ): (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + closure($anonfun) + }) + , + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + , + ctx.traceIndented$default$3[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + )( + [dotty.tools.dotc.ast.tpd.Tree]({ + def $anonfun(): dotty.tools.dotc.ast.tpd.Tree = { + { + val selector17: dotty.tools.dotc.core.Types.Type = pt + { + def case121(): dotty.tools.dotc.ast.tpd.Tree = { + def case131(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail71(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector17) + { + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx). + UnitClass + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant + ( + tree, + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply + ( + ()) + )(ctx) + )(ctx) + else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx). + ArrayClass + ) + ) + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + unboxMethod + (cls.asClass)(ctx) + )(ctx) + ).appliedTo(tree)(ctx) + } + } + } + } + if + selector17.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x24: + dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o41: + Option[(dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + )] + = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + ErasedValueType + ] + ) + if o41.isDefined then { + val x34: + (dotty.tools.dotc.core.Symbols.ClassSymbol, + dotty.tools.dotc.core.Types.Type + ) + = o41.get + { + val clazz: + dotty.tools.dotc.core.Symbols.ClassSymbol + = x34._1 + val underlying: dotty.tools.dotc.core.Types.Type + = + x34._2 + { + { + val tree1: dotty.tools.dotc.ast.tpd.Tree = + if + tree.tpe.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx). + NullClass + )(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (underlying).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, underlying)(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Select[ + dotty.tools.dotc.core.Types.Type + ] + ]( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + dotty.tools.dotc.transform.Erasure.Boxing + . + adaptToType(tree, + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz)(ctx).typeRef(ctx) + )(ctx) + ).select( + dotty.tools.dotc.transform. + ValueClasses + .valueClassUnbox( + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz)(ctx) + )(ctx) + )(ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast + ( + tree1, pt)(ctx) + } + } + } + } else case131() + } + } else case131() + } + case121() + } + } + } + closure($anonfun) + }) + ) + def cast(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel11( + val $this: dotty.tools.dotc.transform.Erasure.Boxing$.type + )(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass)(ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt)(ctx) + else + { + val selector18: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = + Tuple2.apply[dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ](tree.tpe, pt) + { + def case141(): dotty.tools.dotc.ast.tpd.Tree = { + def case151(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail81(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector18) + { + { + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + )(ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree + ](tree).asInstance(pt)(ctx) + } + } + } + { + val o111: + Option[(dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + )] + = + Tuple2.unapply[dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ](selector18) + if o111.isDefined then { + val x25: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = o111.get + { + val p31: dotty.tools.dotc.core.Types.Type = x25._1 + val p44: dotty.tools.dotc.core.Types.Type = x25._2 + if + p31.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x52: dotty.tools.dotc.core.Types.JavaArrayType = + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o102: Option[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Types.JavaArrayType.unapply( + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + ) + if o102.isDefined then { + val x62: dotty.tools.dotc.core.Types.Type = + o102.get + { + val treeElem: dotty.tools.dotc.core.Types.Type + = + x62 + if + p44.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x71: + dotty.tools.dotc.core.Types.JavaArrayType + = + p44.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o92: + Option[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Types.JavaArrayType. + unapply + ( + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + JavaArrayType + ] + ) + if o92.isDefined then { + val x82: dotty.tools.dotc.core.Types.Type + = + o92.get + { + val ptElem: + dotty.tools.dotc.core.Types.Type + = x82 + { + if + dotty.tools.dotc.transform.TypeUtils + . + decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform. + TypeUtils + .decorateTypeUtils(ptElem). + isPrimitiveValueType + (ctx).unary_! + ) + then { + tailLabel11($this)( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types. + Type + ] + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols. + defn + (ctx).runtimeMethod( + dotty.tools.dotc.core. + StdNames + .nme.toObjectArray + ) + )(ctx) + ).appliedTo(tree)(ctx) + , pt)(ctx) + } else case151() + } + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } + case141() + } + } + } + tailLabel11(Boxing$.this)(tree, pt)(ctx) + } + def adaptToType(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel12( + val $this: dotty.tools.dotc.transform.Erasure.Boxing$.type + )(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else { + val selector19: dotty.tools.dotc.core.Types.Type = + tree.tpe.widen(ctx) + { + def case161(): dotty.tools.dotc.ast.tpd.Tree = { + def case171(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail91(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector19) + { + val tpw: dotty.tools.dotc.core.Types.Type = selector19 + { + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType] + . + ||(tree.tpe.<:<(pt)(ctx)) + then tree else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isErasedValueType(ctx) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box(tree + , + [String]({ + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + closure($anonfun) + }) + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isErasedValueType(ctx) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt)(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_! + ) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box( + tree + , + [String]({ + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing + . + box$default$2 + closure($anonfun) + }) + )(ctx) + , pt)(ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_! + ) + then + tailLabel12($this)( + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, pt)(ctx) + , pt)(ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast + ( + tree, pt)(ctx) + } + } + } + if + selector19.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x26: dotty.tools.dotc.core.Types.MethodType = + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o71: + Option[( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + )] + = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o71.isDefined then { + val x35: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + ) + = o71.get + { + val p45: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + = x35._1 + if scala.package.Nil.equals(p45) then { + val x63: + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + = + p45.asInstanceOf[ + => scala.collection.immutable.Nil$.type( + scala.package + .Nil) + ] + { + val p51: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + = x35._2 + if tree.isTerm then { + tailLabel12($this)( + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.tpd.Tree + ](tree).appliedToNone(ctx) + , pt)(ctx) + } else case171() + } + } else case171() + } + } else case171() + } + } else case171() + } + case161() + } + } + tailLabel12(Boxing$.this)(tree, pt)(ctx) + } + } + class Typer() extends dotty.tools.dotc.typer.ReTyper() with + dotty.tools.dotc + .typer.NoChecking { + def checkNonCyclic(val sym: dotty.tools.dotc.core.Symbols.Symbol, + val info: dotty.tools.dotc.core.Types.TypeBounds + , val reportErrors: Boolean)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = + Typer.super[NoChecking].checkNonCyclic(sym, info, reportErrors)(ctx) + def checkValue(val tree: dotty.tools.dotc.ast.tpd.Tree, + val proto: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree(tree) + = Typer.super[NoChecking].checkValue(tree, proto)(ctx) + def checkBounds( + val args: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , val poly: dotty.tools.dotc.core.Types.PolyType)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = Typer.super[NoChecking].checkBounds(args, poly)(ctx) + def checkStable(val tp: dotty.tools.dotc.core.Types.Type, + val pos: dotty.tools.dotc.util.Positions.Position + )(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkStable(tp, pos)(ctx) + def checkLegalPrefix(val tp: dotty.tools.dotc.core.Types.Type, + val selector: dotty.tools.dotc.core.Names.Name + , val pos: dotty.tools.dotc.util.Positions.Position)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = + Typer.super[NoChecking].checkLegalPrefix(tp, selector, pos)(ctx) + def checkClassTypeWithStablePrefix( + val tp: dotty.tools.dotc.core.Types.Type + , val pos: dotty.tools.dotc.util.Positions.Position, + val traitReq: Boolean + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Types.Type + = + Typer.super[NoChecking].checkClassTypeWithStablePrefix(tp, pos, + traitReq + )(ctx) + def checkImplicitParamsNotSingletons( + val vparamss: + scala.collection.immutable.List[ + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.ValDef] + ] + )(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkImplicitParamsNotSingletons(vparamss)(ctx + ) + def checkFeasible(val tp: dotty.tools.dotc.core.Types.Type, + val pos: dotty.tools.dotc.util.Positions.Position + , val where: => String)(val ctx: dotty.tools.dotc.core.Contexts.Context) + : + dotty.tools.dotc.core.Types.Type = + Typer.super[NoChecking].checkFeasible(tp, pos, where)(ctx) + def checkNoDoubleDefs(val cls: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = Typer.super[NoChecking].checkNoDoubleDefs(cls)(ctx) + def checkFeasible$default$3: String @uncheckedVariance = + Typer.super[NoChecking].checkFeasible$default$3 + def erasedType(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = { + val selector110: dotty.tools.dotc.core.Types.Type = tree.typeOpt + { + def case181(): dotty.tools.dotc.core.Types.Type = { + def case191(): dotty.tools.dotc.core.Types.Type = { + def matchFail101(): dotty.tools.dotc.core.Types.Type = + throw new MatchError(selector110) + { + val tp: dotty.tools.dotc.core.Types.Type = selector110 + { + dotty.tools.dotc.core.TypeErasure.erasure(tp)(ctx) + } + } + } + if selector110.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val tp: dotty.tools.dotc.core.Types.TermRef = + selector110.asInstanceOf[ + dotty.tools.dotc.core.Types.TermRef(tp) + ] + { + if tree.isTerm then { + dotty.tools.dotc.core.TypeErasure.erasedRef(tp)(ctx) + } else case191() + } + } else case191() + } + case181() + } + } + def promote(val tree: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): tree.ThisTree[dotty.tools.dotc.core.Types.Type]#Apply = { + assert(tree.hasType) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree)(ctx) + ctx.log( + [String]({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray[String](["promoting ",": ",""]): String* + ).s( + Predef.wrapRefArray[String]( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying( + erased.showWithUnderlying$default$1 + )(ctx) + }] + ): String* + ) + closure($anonfun) + }) + ) + tree.withType(erased)(ctx) + } + def typedLiteral(val tree: dotty.tools.dotc.ast.untpd.Literal)( + val ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Literal = + if + tree.typeOpt.isRef(dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass + ) + (ctc) + then tree.withType(tree.typeOpt)(ctc) else + super.typedLiteral(tree)(ctc) + def typedSelect(val tree: dotty.tools.dotc.ast.untpd.Select, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).exists, + [String]({ + def $anonfun(): String = tree.show(ctx) + closure($anonfun) + }) + ) + def select(val qual: dotty.tools.dotc.ast.tpd.Tree, + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.tpd.Tree = { + val name: sym.ThisName = { + val selector111: dotty.tools.dotc.core.Types.Type = tree.typeOpt + { + def case201(): sym.ThisName = { + def case211(): sym.ThisName = { + def matchFail111(): sym.ThisName = + throw new MatchError(selector111) + { + { + sym.name(ctx) + } + } + } + if + selector111.isInstanceOf[ + dotty.tools.dotc.core.Types.NamedType + ] + then { + val tp: dotty.tools.dotc.core.Types.NamedType = + selector111.asInstanceOf[ + dotty.tools.dotc.core.Types.NamedType(tp) + ] + { + if + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name' + ](tp.name).isInheritedName + then { + dotty.tools.dotc.core.NameOps.NameDecorator[ + sym.ThisName' + ](sym.name(ctx)).inheritedName + } else case211() + } + } else case211() + } + case201() + } + } + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, sym.name(ctx))(ctx + ) + .withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym(qual.tpe, sym)( + ctx + ) + )(ctx) + } + def selectArrayMember(val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = { + def tailLabel14(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val qual: dotty.tools.dotc.ast.tpd.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.tpd.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name + ](tree.name).genericArrayOp + , pt, + Predef.wrapRefArray[dotty.tools.dotc.ast.tpd.Tree]([qual]): + dotty.tools.dotc.ast.tpd.Tree* + )(ctx) + else + if qual.tpe.<:<(erasedPre)(ctx).unary_! then + tailLabel14($this)( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, + erasedPre + )(ctx) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy.Select(tree)(qual, + dotty.tools.dotc.core.NameOps.NameDecorator[ + dotty.tools.dotc.core.Names.Name + ](tree.name).primitiveArrayOp + )(ctx) + , qual)(ctx) + tailLabel14(Typer.this)(qual, erasedPre) + } + def adaptIfSuper(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val selector113: dotty.tools.dotc.ast.tpd.Tree = qual + { + def case231(): dotty.tools.dotc.ast.tpd.Tree = { + def case241(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail131(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector113) + { + { + qual + } + } + } + if + selector113.isInstanceOf[ + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + ] + then { + val x28: + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + = + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + ] + { + val o61: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , dotty.tools.dotc.core.Names.TypeName)] + = + dotty.tools.dotc.ast.Trees.Super.unapply[ + dotty.tools.dotc.core.Types.Type' + ]( + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Super[ + dotty.tools.dotc.core.Types.Type' + ] + ] + ) + if o61.isDefined then { + val x37: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , dotty.tools.dotc.core.Names.TypeName) + = o61.get + { + val thisQual: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x37._1 + val p46: dotty.tools.dotc.core.Names.TypeName = x37._2 + if + dotty.tools.dotc.core.StdNames.tpnme.EMPTY.equals(p46) + then { + val x53: + => dotty.tools.dotc.core.Names.TypeName( + dotty.tools.dotc + .core.StdNames.tpnme.EMPTY) + = + p46.asInstanceOf[ + => dotty.tools.dotc.core.Names.TypeName( + dotty.tools.dotc + .core.StdNames.tpnme.EMPTY) + ] + { + { + val $4$: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = { + val selector112: + dotty.tools.dotc.core.Types.Type @unchecked + = + qual.tpe: + dotty.tools.dotc.core.Types.Type @unchecked + { + def case221(): + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = { + def matchFail121(): + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = throw new MatchError(selector112) + if + selector112.isInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + then { + val x27: + dotty.tools.dotc.core.Types.SuperType + = + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + { + val o42: + Option[( + dotty.tools.dotc.core.Types.Type + , dotty.tools.dotc.core.Types.Type)] + = + dotty.tools.dotc.core.Types.SuperType. + unapply + ( + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + SuperType + ] + ) + if o42.isDefined then { + val x36: + (dotty.tools.dotc.core.Types.Type, + dotty.tools.dotc.core.Types.Type + ) + = o42.get + { + val thisType: + dotty.tools.dotc.core.Types.Type + = x36._1 + val supType: + dotty.tools.dotc.core.Types.Type + = x36._2 + { + Tuple2.apply[ + dotty.tools.dotc.core.Types.Type + ' + , + dotty.tools.dotc.core.Types.Type + ' + ](thisType, supType) + } + } + } else matchFail121() + } + } else matchFail121() + } + case221() + } + } + val thisType: dotty.tools.dotc.core.Types.Type = + $4$._1 + val supType: dotty.tools.dotc.core.Types.Type = + $4$._2 + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx + ) + .owner + )(ctx).is(dotty.tools.dotc.core.Flags.Trait)(ctx + ) + then + dotty.tools.dotc.ast.tpd.cpy.Super(qual)( + thisQual + , + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx + ) + .owner.asClass.name(ctx) + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym) + ( + ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + )(ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , thisType.firstParent(ctx))(ctx) + )(ctx) + } + } + } else case241() + } + } else case241() + } + } else case241() + } + case231() + } + } + def recur(val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + def tailLabel16(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val qual: dotty.tools.dotc.ast.tpd.Tree): + dotty.tools.dotc.ast.tpd.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe.widen(ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).isConstructor + , + [String]({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray[String](["",""]): String* + ).s( + Predef.wrapRefArray[String]( + [{ + sym.showLocated(ctx) + }] + ): String* + ) + closure($anonfun) + }) + ) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass + )(ctx).info(ctx).decl(sym.name(ctx))(ctx).symbol + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe + ).isErasedValueType(ctx) + ) + then + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, + [String]({ + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + closure($anonfun) + }) + )(ctx) + ) + else + if qualIsPrimitive.unary_!.&&(symIsPrimitive) then + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).typeRef(ctx) + )(ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass + ) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier.typeOpt.widen(ctx).finalResultType + )(ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.tpd.Tree = + adaptIfSuper(qual) + if + qual1.tpe.derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).owner + )(ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.tpd.Super] + ) + then select(qual1, sym) else + tailLabel16($this)( + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx). + owner + )(ctx).typeRef(ctx) + )(ctx) + ) + } + } + tailLabel16(Typer.this)(qual) + } + recur( + Typer.this.typed(tree.qualifier, + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + )(ctx) + ) + } + def typedSelectFromTypeTree( + val tree: dotty.tools.dotc.ast.untpd.SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.Type)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name).withPos(tree.pos).withType + ( + Typer.this.erasedType(tree)(ctx))(ctx) + def typedThis(val tree: dotty.tools.dotc.ast.untpd.This)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx))(ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree)(ctx) else { + ctx.log( + [String]({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray[String]( + ["computing outer path from ","%, % to ", + ", encl class = " + ,""] + ): String* + ) + ).i( + Predef.wrapRefArray[ + scala.collection.immutable.List[ + dotty.tools.dotc.core.Symbols.Symbol + ] | dotty.tools.dotc.core.Symbols.Symbol + ]( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + ownersIterator + (ctx).toList + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner)(ctx). + enclosingClass + (ctx) + }] + ): + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Symbols.Symbol + ] + | dotty.tools.dotc.core.Symbols.Symbol)* + )(ctx) + closure($anonfun) + }) + ) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs(val name: dotty.tools.dotc.core.Names.Name + , + val pt: dotty.tools.dotc.core.Types.Type, + val args: scala.collection.Seq[dotty.tools.dotc.ast.tpd.Tree] + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.TermSymbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: + scala.collection.immutable.List[dotty.tools.dotc.core.Types.Type] + = + dotty.tools.dotc.core.Symbols.toDenot(meth)(ctx).info(ctx). + firstParamTypes + .drop(args.length) + val followingArgs: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = + dotty.tools.dotc.core.Decorators.ListDecorator[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + ' + ](Typer.this.protoArgs(pt)).zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](followingParams)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }).asInstanceOf[ + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + ] + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + )(ctx) + ).appliedToArgs( + args.toList.++[dotty.tools.dotc.ast.tpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ]' + ](followingArgs)( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ' + ] + ) + )(ctx) + } + def protoArgs(val pt: dotty.tools.dotc.core.Types.Type): + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + = { + val selector114: dotty.tools.dotc.core.Types.Type = pt + { + def case251(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = { + def case261(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = { + def matchFail141(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = throw new MatchError(selector114) + { + { + scala.package.Nil + } + } + } + if + selector114.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto + ] + then { + val pt: dotty.tools.dotc.typer.ProtoTypes.FunProto = + selector114.asInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto(pt) + ] + { + { + pt.args.++[dotty.tools.dotc.ast.untpd.Tree', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]' + ](Typer.this.protoArgs(pt.resultType))( + scala.collection.immutable.List.canBuildFrom[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ] + ) + } + } + } else case261() + } + case251() + } + } + def typedTypeApply(val tree: dotty.tools.dotc.ast.untpd.TypeApply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val ntree: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree.asInstanceOf[dotty.tools.dotc.ast.tpd.TypeApply] + )(ctx) + { + val selector116: dotty.tools.dotc.ast.tpd.Tree = ntree + { + def case291(): dotty.tools.dotc.ast.tpd.Tree = { + def case301(): dotty.tools.dotc.ast.tpd.Tree = { + def matchFail161(): dotty.tools.dotc.ast.tpd.Tree = + throw new MatchError(selector116) + { + { + Typer.this.typedExpr(ntree, pt)(ctx) + } + } + } + if + selector116.isInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + then { + val x29: + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + = + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + { + val o43: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + dotty.tools.dotc.ast.Trees.TypeApply.unapply[ + dotty.tools.dotc.core.Types.Type' + ]( + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply[ + dotty.tools.dotc.core.Types.Type' + ] + ] + ) + if o43.isDefined then { + val x38: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o43.get + { + val fun: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x38._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x38._2 + { + { + val fun1: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + )(ctx) + { + val selector115: dotty.tools.dotc.core.Types.Type + = + fun1.tpe.widen(ctx) + { + def case271(): dotty.tools.dotc.ast.tpd.Tree = { + def case281(): dotty.tools.dotc.ast.tpd.Tree + = + { + def matchFail151(): + dotty.tools.dotc.ast.tpd.Tree + = throw new MatchError(selector115) + { + { + fun1 + } + } + } + if + selector115.isInstanceOf[ + dotty.tools.dotc.core.Types.PolyType + ] + then { + val funTpe: + dotty.tools.dotc.core.Types.PolyType + = + selector115.asInstanceOf[ + dotty.tools.dotc.core.Types.PolyType( + funTpe + ) + ] + { + { + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + dotty.tools.dotc.core.Decorators. + ListDecorator + [ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ](args).mapconserve[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types. + Type + ] + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.typedType(_$1, + Typer.this.typedType$default$2 + )(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.TypeApply + ( + tree)(fun1, args1)(ctx).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd. + ListOfTreeDecorator + (args1).tpes + )(ctx) + )(ctx) + } + } + } else case281() + } + case271() + } + } + } + } + } + } else case301() + } + } else case301() + } + case291() + } + } + } + def typedApply(val tree: dotty.tools.dotc.ast.untpd.Apply, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = { + val $5$: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = { + val selector117: dotty.tools.dotc.ast.untpd.Apply @unchecked = + tree: dotty.tools.dotc.ast.untpd.Apply @unchecked + { + def case311(): + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = { + def matchFail171(): + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = throw new MatchError(selector117) + { + val o31: + Option[(dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + )] + = + dotty.tools.dotc.ast.Trees.Apply.unapply[Null'](selector117) + if o31.isDefined then { + val x210: + (dotty.tools.dotc.ast.Trees.Tree[Null], + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + ) + = o31.get + { + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = x210._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = x210._2 + { + Tuple2.apply[dotty.tools.dotc.ast.Trees.Tree[Null]', + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ]' + ](fun, args) + } + } + } else matchFail171() + } + } + case311() + } + } + val fun: dotty.tools.dotc.ast.Trees.Tree[Null] = $5$._1 + val args: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = $5$._2 + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply + ) + then Typer.this.typedUnadapted(args.head, pt)(ctx) else { + val selector119: dotty.tools.dotc.ast.tpd.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this) + ( + ctx) + )(ctx) + { + def case341(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def case351(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def matchFail191(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = throw new MatchError(selector119) + { + val fun1: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = selector119 + { + { + val selector118: dotty.tools.dotc.core.Types.Type = + fun1.tpe.widen(ctx) + { + def case321(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def case331(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = { + def matchFail181(): + dotty.tools.dotc.ast.Trees.Apply[ + dotty.tools.dotc.core.Types.Type + ] + = throw new MatchError(selector118) + { + { + throw + new MatchError( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + Predef.wrapRefArray[String]( + ["tree ", + " has unexpected type of function " + ,", was ",""] + ): String* + ) + ).i( + Predef.wrapRefArray[ + dotty.tools.dotc.ast.untpd.Apply | + dotty.tools.dotc.core.Types.Type + ]( + [tree,{ + fun1.tpe.widen(ctx) + },{ + fun.typeOpt.widen(ctx) + }] + ): + (dotty.tools.dotc.ast.untpd.Apply | + dotty.tools.dotc.core.Types.Type + )* + )(ctx) + ) + } + } + } + if + selector118.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val mt: dotty.tools.dotc.core.Types.MethodType = + selector118.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType(mt) + ] + { + { + val outers: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = + dotty.tools.dotc.transform.ExplicitOuter. + outer + (ctx).args( + fun.asInstanceOf[ + dotty.tools.dotc.ast.tpd.Tree + ] + ) + val args1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null] + ] + = + { + val $6$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + = outers + dotty.tools.dotc.core.Decorators. + ListDecorator + [dotty.tools.dotc.ast.Trees.Tree[Null]']( + args.++[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[Null + ] + ' + ]' + ](Typer.this.protoArgs(pt))( + scala.collection.immutable.List. + canBuildFrom + [ + dotty.tools.dotc.ast.Trees.Tree[Null + ] + ' + ] + ).:::[ + dotty.tools.dotc.ast.Trees.Tree[Null]' + ]($6$) + ) + }.zipWithConserve[ + dotty.tools.dotc.core.Types.Type' + ](mt.paramTypes)({ + def $anonfun( + tree: + dotty.tools.dotc.ast.Trees.Tree[Null] + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree[Null] + = Typer.this.typedExpr(tree, pt)(ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy.Apply(tree)( + fun1 + , args1)(ctx).withType(mt.resultType)(ctx) + } + } + } else case331() + } + case321() + } + } + } + } + } + if selector119.isInstanceOf[dotty.tools.dotc.ast.tpd.Apply] then + + { + val fun1: dotty.tools.dotc.ast.tpd.Apply = + selector119.asInstanceOf[ + dotty.tools.dotc.ast.tpd.Apply(fun1) + ] + { + { + fun1 + } + } + } + else case351() + } + case341() + } + } + } + def typedSeqLiteral(val tree: dotty.tools.dotc.ast.untpd.SeqLiteral, + val pt: dotty.tools.dotc.core.Types.Type + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.SeqLiteral + = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt)(ctx) + )(ctx) + def typedValDef(val vdef: dotty.tools.dotc.ast.untpd.ValDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2)(ctx).withPos( + vdef.tpt.pos + ) + ) + val rhs$1: dotty.tools.dotc.ast.untpd.Tree = + dotty.tools.dotc.ast.untpd.cpy.ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy.ValDef(vdef)(name$3, tpt$1, rhs$1) + }, sym)(ctx) + def typedDefDef(val ddef: dotty.tools.dotc.ast.untpd.DefDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef[dotty.tools.dotc.core.Types.Type] + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym)(ctx).info(ctx).resultType + val ddef1: dotty.tools.dotc.ast.untpd.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName @uncheckedVariance + = + dotty.tools.dotc.ast.untpd.cpy.DefDef$default$2(ddef) + val vparamss$1: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + ] + = { + val $7$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + = + ddef.vparamss.flatten[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ] + ) + scala.package.Nil.::[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.ValDef[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ]' + ]($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2 + )(ctx).withPos(ddef.tpt.pos) + ) + val rhs$2: + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.ast.Trees.Untyped + ] + = { + val selector120: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = ddef.rhs + { + def case361(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = { + def case371(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = { + def matchFail201(): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = throw new MatchError(selector120) + { + { + ddef.rhs + } + } + } + if + selector120.isInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + ] + then { + val x211: + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + ] + { + val o62: Option[dotty.tools.dotc.core.Names.Name] = + dotty.tools.dotc.ast.Trees.Ident.unapply[ + dotty.tools.dotc.ast.Trees.Untyped' + ]( + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped' + ] + ] + ) + if o62.isDefined then { + val x39: dotty.tools.dotc.core.Names.Name = o62.get + { + val p47: dotty.tools.dotc.core.Names.Name = x39 + if + dotty.tools.dotc.core.StdNames.nme.WILDCARD.equals( + p47 + ) + then { + val x54: + => dotty.tools.dotc.core.Names.TermName( + dotty.tools.dotc + .core.StdNames.nme.WILDCARD) + = + p47.asInstanceOf[ + => dotty.tools.dotc.core.Names.TermName( + dotty.tools.dotc + .core.StdNames.nme.WILDCARD) + ] + { + val id: + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped + ] + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident[ + dotty.tools.dotc.ast.Trees.Untyped + ] + ] + { + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe)(ctx) + ) + } + } + } else case371() + } + } else case371() + } + } else case371() + } + case361() + } + } + dotty.tools.dotc.ast.untpd.cpy.DefDef(ddef)(name$4, + scala.package.Nil + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym)(ctx) + } + def typedTypeDef(val tdef: dotty.tools.dotc.ast.untpd.TypeDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree + def typedStats( + val stats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , val exprOwner: dotty.tools.dotc.core.Symbols.Symbol)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] = { + val stats1: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type] + ] + = + dotty.tools.dotc.ast.Trees.flatten[dotty.tools.dotc.core.Types.Type' + ] + (super.typedStats(stats, exprOwner)(ctx)) + if ctx.owner.isClass then { + val $8$: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type + ] + ] + = stats1 + Typer.this.addBridges(stats, stats1)(ctx).:::[ + dotty.tools.dotc.ast.tpd.Tree' + ]($8$) + } else stats1 + } + def addBridges( + val oldStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val newStats: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase + ) + def traverse( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] = + { + def tailLabel30(val $this: dotty.tools.dotc.transform.Erasure.Typer) + ( + val after: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + , + val before: + scala.collection.immutable.List[dotty.tools.dotc.ast.untpd.Tree] + , + val emittedBridges: + collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + ): scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.DefDef] + = + { + { + val selector123: + scala.collection.immutable.List[dotty.tools.dotc.ast.tpd.Tree] + = after + { + def case431(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case441(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case451(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def matchFail231(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = throw new MatchError(selector123) + if + selector123.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + then { + val x65: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + { + val o82: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + ) + if o82.isDefined then { + val x73: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o82.get + { + val newTail: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x73._2 + { + { + tailLabel30($this)(newTail, before, + traverse$default$3 + ) + } + } + } + } else matchFail231() + } + } else matchFail231() + } + if + selector123.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + then { + val x312: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + { + val o94: + Option[( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ]( + selector123.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ] + ) + if o94.isDefined then { + val x43: + ( + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + ) + = o94.get + { + val pi52: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + = x43._1 + val newTail: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + ] + = x43._2 + if + pi52.isInstanceOf[ + dotty.tools.dotc.ast.tpd.DefDef + ] + then { + val member: dotty.tools.dotc.ast.tpd.DefDef = + pi52.asInstanceOf[ + dotty.tools.dotc.ast.tpd.DefDef(member) + ] + { + { + { + val selector122: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.untpd.Tree + ] + = before + { + def case401(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case411(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def case421(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.DefDef + ] + = { + def matchFail221(): + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd. + DefDef + ] + = + throw + new MatchError(selector122) + if + selector122.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ] + ] + then { + val x64: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ] + = + selector122.asInstanceOf[ + scala.collection.immutable. + :: + [ + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + ] + { + val o81: + Option[( + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + , + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ]( + selector122.asInstanceOf[ + scala.collection.immutable + . + ::[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast + . + Trees.Untyped + ] + ] + ] + ) + if o81.isDefined then { + val x72: + ( + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + , + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast + . + Trees.Untyped + ] + ] + ) + = o81.get + { + val oldTail: + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast + . + Trees.Untyped + ] + ] + = x72._2 + { + { + tailLabel30($this)( + after + , oldTail, + traverse$default$3 + ) + } + } + } + } else matchFail221() + } + } else matchFail221() + } + if + selector122.isInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees. + Untyped + ] + ] + ] + then { + val x311: + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees. + Untyped + ] + ] + = + selector122.asInstanceOf[ + scala.collection.immutable.::[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ] + ] + { + val o93: + Option[( + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + , + scala.collection.immutable. + List + [ + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + )] + = + scala.package.::.unapply[ + dotty.tools.dotc.ast.Trees. + Tree + [ + dotty.tools.dotc.ast.Trees + . + Untyped + ] + ]( + selector122.asInstanceOf[ + scala.collection.immutable + . + ::[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + ] + ) + if o93.isDefined then { + val x42: + ( + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + , + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + ) + = o93.get + { + val pi51: + dotty.tools.dotc.ast.Trees + . + Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + = x42._1 + val oldTail: + scala.collection.immutable + . + List[ + dotty.tools.dotc.ast. + Trees + .Tree[ + dotty.tools.dotc.ast. + Trees + .Untyped + ] + ] + = x42._2 + if + pi51.isInstanceOf[ + dotty.tools.dotc.ast. + untpd + .DefDef + ] + then { + val oldMember: + dotty.tools.dotc.ast. + untpd + .DefDef + = + pi51.asInstanceOf[ + dotty.tools.dotc.ast. + untpd + .DefDef(oldMember) + ] + { + { + val oldSymbol: + dotty.tools.dotc.core + . + Symbols.Symbol + = + oldMember.symbol( + beforeCtx + ) + val newSymbol: + dotty.tools.dotc.core + . + Symbols.Symbol + = member.symbol(ctx) + assert( + oldSymbol.name( + beforeCtx + ).==( + newSymbol.name(ctx + ) + ) + , + [String + ] + ({ + def $anonfun(): + String + = + StringContext. + apply + ( + Predef. + wrapRefArray + [String]( + ["", + " bridging with " + ,""] + ): String* + ).s( + Predef. + wrapRefArray + [ + oldSymbol. + ThisName + | + newSymbol. + ThisName + ]( + [{ + oldSymbol. + name + (beforeCtx + ) + },{ + newSymbol. + name + (ctx) + }] + ): + ( + oldSymbol. + ThisName + | + newSymbol. + ThisName + )* + ) + closure($anonfun) + }) + ) + val newOverridden: + scala.collection.immutable + . + Set[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + = + oldSymbol.denot(ctx) + . + allOverriddenSymbols + ( + ctx).toSet[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + val oldOverridden: + scala.collection.immutable + . + Set[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + = + dotty.tools.dotc. + core + .Symbols.toDenot( + newSymbol + )(ctx). + allOverriddenSymbols + (beforeCtx).toSet[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + def stillInBaseClass( + val sym: + dotty.tools.dotc. + core + .Symbols.Symbol + ): Boolean = + dotty.tools.dotc. + core + .Symbols.toDenot( + ctx.owner + )(ctx).derivesFrom( + dotty.tools.dotc. + core + .Symbols.toDenot( + sym + )(ctx).owner + )(ctx) + val neededBridges: + scala.collection.immutable + . + Set[ + dotty.tools.dotc.core + . + Symbols.Symbol + ] + = + oldOverridden.--( + newOverridden + ).filter({ + def $anonfun( + val sym: + dotty.tools.dotc.core + . + Symbols.Symbol + ): Boolean = + stillInBaseClass + ( + sym) + closure($anonfun) + }) + val minimalSet: + scala.collection.immutable + . + Set[ + dotty.tools.dotc. + core + .Symbols.Symbol + ] + = + Set.apply[ + dotty.tools.dotc. + core + .Symbols.Symbol + ]( + Predef. + genericWrapArray + [Nothing]([]): + Nothing* + ) + neededBridges.foreach[ + Unit + ]({ + def $anonfun( + val bridge: + dotty.tools.dotc.core + . + Symbols.Symbol + ): Unit = { + val isRequired: + Boolean + = + minimalSet. + forall + ({ + def $anonfun( + nxtBridge: + dotty.tools.dotc + . + core. + Symbols + .Symbol + ): Boolean = + dotty.tools.dotc + . + core.Symbols + . + toDenot( + bridge + )(ctx).info( + ctx + ).=:=( + dotty.tools.dotc + . + core. + Symbols + .toDenot( + nxtBridge + )(ctx). + info + (ctx) + )(ctx). + unary_! + closure( + $anonfun + ) + }) + if isRequired then + + { + val clash: + Option[ + dotty.tools.dotc + . + core.Symbols + . + Symbol + ] + = + dotty.tools.dotc + . + core.Symbols. + toDenot + ( + dotty.tools.dotc + . + core.Symbols + . + toDenot( + oldSymbol + )(ctx).owner + )(ctx).decls( + ctx + ).lookupAll( + bridge.name( + ctx + ) + )(ctx).find({ + { + def + $anonfun + ( + sym: + dotty.tools.dotc.core + . + Symbols + . + Symbol + ): Boolean + = + { + sym.name + ( + ctx).eq( + bridge + . + name( + ctx + ) + ).&&( + dotty.tools.dotc + . + core. + Symbols + . + toDenot + (sym)( + ctx + ).info + ( + ctx). + widen + (ctx). + =:= + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + ) + (ctx + ) + . + info + ( + ctx) + . + widen + ( + ctx) + )(ctx) + ) + } + closure( + $anonfun + ) + } + }).orElse[ + dotty.tools.dotc.core + . + Symbols. + Symbol + ]( + + [ + Option[ + dotty.tools.dotc.core + . + Symbols. + Symbol + ] + ]({ + def + $anonfun + (): + Option[ + dotty.tools.dotc.core + . + Symbols + . + Symbol + ] + = + emittedBridges + . + find({ + def + $anonfun + ( + val + stat + : + dotty + . + tools + . + dotc + . + ast + . + tpd + . + DefDef + ): + Boolean + = + stat + . + name + . + ==( + bridge + . + name + ( + ctx + ) + ).&& + ( + stat + . + tpe. + widen + (ctx + ) + .=:= + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + ) + (ctx + ) + . + info + ( + ctx) + . + widen + ( + ctx) + ) + (ctx + ) + ) + closure( + $anonfun + ) + }).map[ + dotty.tools.dotc.core + . + Symbols + . + Symbol + ]({ + def + $anonfun + ( + val + _$2 + : + dotty + . + tools + . + dotc + . + ast + . + tpd + . + DefDef + ): + dotty.tools.dotc.core + . + Symbols + . + Symbol + = + _$2. + symbol + (ctx + ) + closure( + $anonfun + ) + }) + closure( + $anonfun + ) + }) + ) + { + val + selector121 + : + Option[ + dotty.tools.dotc + . + core. + Symbols + .Symbol + ] + = clash + { + def case381( + ) + : Unit = { + def + case391 + (): Unit + = + { + def + matchFail211 + (): Unit + = + throw + new + MatchError + ( + selector121 + ) + if + None. + equals + ( + selector121 + ) + then { + val + x41 + : + None$ + .type + = + selector121 + . + asInstanceOf + [ + None$ + .type + ] + { + { + minimalSet + = + minimalSet + . + +( + bridge + ) + } + } + } else + matchFail211 + ( + ) + } + if + selector121 + . + isInstanceOf + [ + Some[ + dotty.tools.dotc + . + core. + Symbols + . + Symbol + ] + ] + then { + val x212 + : + Some[ + dotty.tools.dotc + . + core. + Symbols + . + Symbol + ] + = + selector121 + . + asInstanceOf + [ + Some[ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ] + ] + { + val + o53 + : + Option + [ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ] + = + Some. + unapply + [ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ]( + selector121 + . + asInstanceOf + [ + Some + [ + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + ] + ] + ) + if + o53. + isDefined + then + { + val + x310 + : + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + = + o53. + get + { + val + + cl + : + dotty.tools.dotc + . + core + . + Symbols + . + Symbol + = + x310 + { + { + ctx + . + error + ( + + [ + String + ] + ( + { + def + + $anonfun + ( + ) + : + String + = + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + [ + String + ] + ( + [ + "bridge for method " + , + " of type " + , + "\\n" + ] + ) + : + String + * + ) + ) + . + i + ( + Predef + . + wrapRefArray + [ + String + | + dotty.tools.dotc.core + . + Types + . + Type + ] + ( + [ + { + newSymbol + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + newSymbol + ) + ( + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + ) + : + ( + String + | + dotty.tools.dotc.core + . + Types + . + Type + ) + * + ) + ( + ctx + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + [ + String + ] + ( + [ + "clashes with " + , + " of type " + , + "\\n" + ] + ) + : + String + * + ) + ) + . + i + ( + Predef + . + wrapRefArray + [ + String + | + dotty.tools.dotc.core + . + Types + . + Type + ] + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + ) + ( + ctx + ) + . + symbol + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + ) + ( + ctx + ) + . + symbol + ) + ( + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + ) + : + ( + String + | + dotty.tools.dotc.core + . + Types + . + Type + ) + * + ) + ( + ctx + ) + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + [ + String + ] + ( + [ + "both have same type after erasure: " + , + "" + ] + ) + : + String + * + ) + ) + . + i + ( + Predef + . + wrapRefArray + [ + dotty.tools.dotc.core + . + Types + . + Type + ] + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + ) + ( + ctx + ) + . + symbol + ) + ( + ctx + ) + . + info + ( + ctx + ) + } + ] + ) + : + dotty.tools.dotc.core + . + Types + . + Type + * + ) + ( + ctx + ) + ) + closure( + $anonfun + ) + } + ) + , + ctx + . + error$default$2 + ) + } + } + } + } + else + case391 + ( + ) + } + } else + case391( + ) + } + case381() + } + } + } + else () + } + closure($anonfun) + }) + val + bridgeImplementations + : + scala.collection.immutable + . + Set[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + ] + = + minimalSet.map[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + , + scala.collection.immutable + . + Set[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + ] + ]({ + { + def $anonfun( + sym: + dotty.tools.dotc + . + core.Symbols + . + Symbol + ): + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + = { + $this. + makeBridgeDef + (member, sym)( + ctx + ) + } + closure($anonfun + ) + } + })( + scala.collection.immutable + . + Set.canBuildFrom[ + dotty.tools.dotc.ast + . + Trees.DefDef[ + dotty.tools.dotc.core + . + Types.Type + ] + ] + ) + emittedBridges.++=( + bridgeImplementations + ) + tailLabel30($this)( + newTail + , oldTail, + traverse$default$3 + ) + } + } + } else case421() + } + } else case421() + } + } else case421() + } + if + scala.package.Nil.equals(selector122 + ) + then { + val x213: + => + scala.collection.immutable.Nil$ + .type + (scala.package.Nil) + = + selector122.asInstanceOf[ + => + scala.collection.immutable. + Nil$ + .type + (scala.package.Nil) + ] + { + { + emittedBridges.toList + } + } + } else case411() + } + case401() + } + } + } + } + } else case451() + } + } else case451() + } + } else case451() + } + if scala.package.Nil.equals(selector123) then { + val x214: + => scala.collection.immutable.Nil$.type(scala.package. + Nil + ) + = + selector123.asInstanceOf[ + => scala.collection.immutable.Nil$.type(scala.package. + Nil + ) + ] + { + { + emittedBridges.toList + } + } + } else case441() + } + case431() + } + } + } + tailLabel30(Typer.this)(after, before, emittedBridges) + } + def traverse$default$3: + scala.collection.mutable.ListBuffer[dotty.tools.dotc.ast.tpd.DefDef] + = + collection.mutable.ListBuffer.apply[dotty.tools.dotc.ast.tpd.DefDef] + ( + Predef.genericWrapArray[Nothing]([]): Nothing*) + traverse(newStats, oldStats, traverse$default$3) + } + def makeBridgeDef(val newDef: dotty.tools.dotc.ast.tpd.DefDef, + val parentSym: dotty.tools.dotc.core.Symbols.Symbol + )(val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.tpd.DefDef + = { + def error(val reason: String): Nothing = { + assert(false, + [String]({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray[String]( + ["failure creating bridge from "," to ",", reason: ",""] + ): String* + ).s( + Predef.wrapRefArray[ + dotty.tools.dotc.core.Symbols.Symbol | String + ]( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason] + ): (dotty.tools.dotc.core.Symbols.Symbol | String)* + ) + closure($anonfun) + }) + ) + ??? + } + val bridge: dotty.tools.dotc.core.Symbols.TermSymbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + val name$5: parentSym.ThisName = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym)(ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols.Symbol @uncheckedVariance + = ctx.newSymbol$default$5[parentSym.ThisName'] + ctx.newSymbol[parentSym.ThisName'](owner$3, name$5, flags$1, + info$3 + , privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .coord + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase.prev.asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + )(ctx) + ctx.debuglog( + [String]({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray[String]( + ["generating bridge from "," to ",""] + ): String* + ).s( + Predef.wrapRefArray[dotty.tools.dotc.core.Symbols.Symbol]( + [{ + newDef.symbol(ctx) + },bridge] + ): dotty.tools.dotc.core.Symbols.Symbol* + ) + closure($anonfun) + }) + ) + val sel: dotty.tools.dotc.ast.tpd.Tree = + dotty.tools.dotc.ast.tpd.TreeOps[ + dotty.tools.dotc.ast.Trees.This[dotty.tools.dotc.core.Types.Type]' + ]( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + owner + .asClass + )(ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx))(ctx). + termRef + (ctx) + )(ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge)(ctx).info(ctx).widen( + ctx + ).resultType + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun( + val paramss: + scala.collection.immutable.List[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val rhs: dotty.tools.dotc.ast.tpd.Tree = + paramss.foldLeft[dotty.tools.dotc.ast.tpd.Tree'](sel)({ + def $anonfun(fun: dotty.tools.dotc.ast.tpd.Tree, + vparams: + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ] + ): dotty.tools.dotc.ast.tpd.Tree = { + val selector124: dotty.tools.dotc.core.Types.Type = + fun.tpe.widen(ctx) + { + def case461(): dotty.tools.dotc.ast.tpd.Apply = { + def case471(): dotty.tools.dotc.ast.tpd.Apply = { + def matchFail241(): dotty.tools.dotc.ast.tpd.Apply + = + throw new MatchError(selector124) + { + val a: dotty.tools.dotc.core.Types.Type = + selector124 + { + error( + StringContext.apply( + Predef.wrapRefArray[String]( + ["can not resolve apply type ",""] + ): String* + ).s( + Predef.wrapRefArray[ + dotty.tools.dotc.core.Types.Type + ]([a]): dotty.tools.dotc.core.Types.Type* + ) + ) + } + } + } + if + selector124.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x215: dotty.tools.dotc.core.Types.MethodType = + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o44: + Option[( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + )] + = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o44.isDefined then { + val x313: + ( + scala.collection.immutable.List[ + dotty.tools.dotc.core.Names.TermName + ] + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + ) + = o44.get + { + val types: + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ] + = x313._2 + { + { + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + Tuple2.apply[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ](vparams, types) + ).zipped[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + , dotty.tools.dotc.core.Types.Type', + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ]( + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.ast.tpd.Tree + ]' + ] + , + $conforms[ + scala.collection.immutable.List[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ).map[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + , + scala.collection.immutable.List[ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ]' + ]({ + def $anonfun( + _$3: + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ] + , + _$4: + dotty.tools.dotc.core.Types.Type + ): + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd. + EmptyTree + )(ctx) + closure($anonfun) + })( + scala.collection.immutable.List. + canBuildFrom + [ + dotty.tools.dotc.ast.Trees.Tree[ + dotty.tools.dotc.core.Types.Type + ]' + ] + ) + )(ctx) + } + } + } + } else case471() + } + } else case471() + } + case461() + } + } + closure($anonfun) + }) + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3)( + ctx + ) + } + closure($anonfun) + } + })(ctx) + } + def adapt(val tree: dotty.tools.dotc.ast.tpd.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val original: dotty.tools.dotc.ast.untpd.Tree)( + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.tpd.Tree = { + val printer$1: + dotty.tools.dotc.config.Printers.Printer @uncheckedVariance + = + ctx.traceIndented$default$2[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ] + ctx.traceIndented[ + dotty.tools.dotc.ast.Trees.Tree[dotty.tools.dotc.core.Types.Type]' + ]( + [String]({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray[String](["adapting ",": "," to ",""]): + String* + ) + ).i( + Predef.wrapRefArray[String | dotty.tools.dotc.core.Types.Type] + ( + [{ + tree.showSummary(ctx) + },{ + tree.tpe + },pt] + ): (String | dotty.tools.dotc.core.Types.Type)* + )(ctx) + closure($anonfun) + }) + , printer$1, true)( + [dotty.tools.dotc.ast.tpd.Tree]({ + def $anonfun(): dotty.tools.dotc.ast.tpd.Tree = { + assert( + ctx.phase.==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx). + erasurePhase + .next + ) + , + [dotty.tools.dotc.core.Phases.Phase]({ + def $anonfun(): dotty.tools.dotc.core.Phases.Phase = + ctx.phase + closure($anonfun) + }) + ) + if tree.isEmpty then tree else + if ctx.mode.is(dotty.tools.dotc.typer.Mode.Pattern) then tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt + ) + (ctx) + } + closure($anonfun) + }) + ) + } + } + val Typer: dotty.tools.dotc.transform.Erasure.Typer$ = + new dotty.tools.dotc.transform.Erasure.Typer$() + class Typer$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Typer$.type => + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after erasure: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure() extends dotty.tools.dotc.util.DotClass() with + dotty.tools.dotc.core.Phases + .Phase with dotty.tools.dotc.core.DenotTransformers.DenotTransformer { + thisTransformer: dotty.tools.dotc.transform.Erasure => + + def toString(): String = Erasure.super[Phase].toString() + def phaseName(): String = "erasure" + def runsAfter(): scala.collection.immutable.Set = + Set().apply( + Predef.wrapRefArray([classOf(),classOf(),classOf()]): + ).asInstanceOf[scala.collection.immutable.Set] + def transform(val ref: dotty.tools.dotc.core.Denotations.SingleDenotation + , + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Denotations.SingleDenotation + = { + val selector12: dotty.tools.dotc.core.Denotations.SingleDenotation = ref + { + def case21(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def case31(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def matchFail21(): + dotty.tools.dotc.core.Denotations.SingleDenotation + = throw new MatchError(selector12) + { + val ref: dotty.tools.dotc.core.Denotations.SingleDenotation = + selector12 + { + ref.derivedSingleDenotation(ref.symbol(), + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx), + ctx + ) + , ctx) + } + } + } + if + selector12.isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ] + then { + val ref: dotty.tools.dotc.core.SymDenotations.SymDenotation = + selector12.asInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ] + { + { + assert(ctx.phase().==(this), { + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray(["transforming "," at ",""]): + + ).s( + Predef.wrapRefArray( + [ref,{ + ctx.phase().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + }] + ): + ) + closure($anonfun:Function0) + }) + if + ref.symbol().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + ) + then { + val $1$: Tuple4 = { + val selector11: dotty.tools.dotc.core.Types.Type = + ref.info(ctx): dotty.tools.dotc.core.Types.Type + { + def case11(): Tuple4 = { + def matchFail11(): Tuple4 = + throw new MatchError(selector11) + if + selector11.isInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + then { + val x21: dotty.tools.dotc.core.Types.ClassInfo = + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + { + val o51: Option = + dotty.tools.dotc.core.Types.ClassInfo.unapply( + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + ) + if o51.isDefined() then { + val x31: Tuple5 = o51.get().asInstanceOf[Tuple5] + { + val pre: dotty.tools.dotc.core.Types.Type = + x31._1().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + val ps: scala.collection.immutable.List = + x31._3().asInstanceOf[ + scala.collection.immutable.List + ] + val decls: dotty.tools.dotc.core.Scopes.Scope + = + x31._4().asInstanceOf[ + dotty.tools.dotc.core.Scopes.Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass + = + x31._5().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + { + val p41: + dotty.tools.dotc.core.Symbols.ClassSymbol + = + x31._2().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + ClassSymbol + ] + Tuple4.apply(pre, ps, decls, selfInfo) + } + } + } else matchFail11() + } + } else matchFail11() + } + case11() + } + } + val pre: dotty.tools.dotc.core.Types.Type = + $1$._1().asInstanceOf[dotty.tools.dotc.core.Types.Type] + val ps: scala.collection.immutable.List = + $1$._2().asInstanceOf[scala.collection.immutable.List] + val decls: dotty.tools.dotc.core.Scopes.Scope = + $1$._3().asInstanceOf[dotty.tools.dotc.core.Scopes.Scope] + val selfInfo: dotty.tools.dotc.util.DotClass = + $1$._4().asInstanceOf[dotty.tools.dotc.util.DotClass] + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope + = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + , ctx).classInfo(ctx).decls().foreach({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol + = extendedScope.enter(sym, ctx) + closure($anonfun) + }) + { + val symbol$1: dotty.tools.dotc.core.Symbols.Symbol = + ref.copySymDenotation$default$1() + val owner$1: dotty.tools.dotc.core.Symbols.Symbol = + ref.copySymDenotation$default$2() + val name$1: dotty.tools.dotc.core.Names.Name = + ref.copySymDenotation$default$3() + val initFlags$1: dotty.tools.dotc.core.Flags.FlagSet = + ref.copySymDenotation$default$4() + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass( + ) + , ps, extendedScope, selfInfo, ctx) + , ctx) + val privateWithin$1: dotty.tools.dotc.core.Symbols.Symbol + = + ref.copySymDenotation$default$6() + val annotations$1: scala.collection.immutable.List = + ref.copySymDenotation$default$7() + ref.copySymDenotation(symbol$1, owner$1, name$1, + initFlags$1 + , info$1, privateWithin$1, annotations$1, ctx) + } + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = + ref.owner() + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if + oldOwner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + ) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + else oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = + ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , oldInfo, ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~( + dotty.tools.dotc.core.Flags.HasDefaultParams() + ) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass(), ctx). + unary_! + () + , { + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""] + ): + ).s( + Predef.genericWrapArray( + [ref,{ + ctx.phase() + },oldOwner,newOwner,oldInfo,newInfo,{ + scala.Boolean.box(oldOwner.eq(newOwner)) + },{ + scala.Boolean.box(oldInfo.eq(newInfo)) + }] + ): + ) + closure($anonfun:Function0) + }) + { + val symbol$2: dotty.tools.dotc.core.Symbols.Symbol = + ref.copySymDenotation$default$1() + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = + newOwner + val name$2: dotty.tools.dotc.core.Names.Name = + ref.copySymDenotation$default$3() + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, + initFlags$2 + , info$2, ref.copySymDenotation$default$6(), + ref.copySymDenotation$default$7() + , ctx) + } + } + } + } + } + } else case31() + } + case21() + } + } + def eraser(): dotty.tools.dotc.transform.Erasure.Typer = + new dotty.tools.dotc.transform.Erasure.Typer() + def run(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit() + unit.tpdTree_=( + Erasure.this.eraser().typedExpr(unit.tpdTree(), + Erasure.this.eraser().typedExpr$default$2() + , ctx.fresh().setPhase(this.next())) + ) + } + def checkPostCondition(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree, ctx) + { + val selector13: dotty.tools.dotc.ast.Trees.Tree = tree + { + def case41(): Unit = { + def case51(): Unit = { + def matchFail31(): Unit = throw new MatchError(selector13) + { + { + () + } + } + } + if selector13.isInstanceOf[dotty.tools.dotc.ast.Trees.This] then { + val res: dotty.tools.dotc.ast.Trees.This = + selector13.asInstanceOf[dotty.tools.dotc.ast.Trees.This] + { + { + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + , res, ctx).unary_!() + , { + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["Reference to "," from ",""]): + + ) + ).i( + Predef.wrapRefArray( + [res,{ + ctx.owner().showLocated(ctx) + }] + ): + , ctx) + closure($anonfun:Function0) + }) + } + } + } else case51() + } + case41() + } + } + } + def assertErased(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt(), tree, ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure(). + apply + (tree.symbol(ctx)).unary_!() + then Erasure.this.assertErased(tree.typeOpt().widen(ctx), tree, ctx) + else + () + if ctx.mode().isExpr() then { + val selector14: dotty.tools.dotc.core.Types.Type = + tree.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + { + def case61(): Unit = { + def case71(): Unit = { + def matchFail41(): Unit = throw new MatchError(selector14) + { + { + () + } + } + } + if selector14.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val ref: dotty.tools.dotc.core.Types.TermRef = + selector14.asInstanceOf[dotty.tools.dotc.core.Types.TermRef] + { + { + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , { + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["non-sym type "," of class ", + " with denot of class " + ," of ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree] + ): + , ctx) + closure($anonfun:Function0) + }) + } + } + } else case71() + } + case61() + } + } else () + } + def assertErased(val tp: dotty.tools.dotc.core.Types.Type, + val tree: dotty.tools.dotc.ast.Trees.Tree + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp, ctx), { + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""] + ): + ) + ).i( + Predef.wrapRefArray( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe() + },{ + tree.getClass() + },{ + ctx.phase() + }] + ): + , ctx) + closure($anonfun:Function0) + }) + def assertErased$default$2(): dotty.tools.dotc.ast.Trees.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree() + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$() extends Object() with dotty.tools.dotc.transform. + TypeTestsCasts + { this: => + val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ = + new dotty.tools.dotc.transform.Erasure.Boxing$() + class Boxing$() extends Object() { this: => + def isUnbox(val sym: dotty.tools.dotc.core.Symbols.Symbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().unbox()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses().contains + ( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def isBox(val sym: dotty.tools.dotc.core.Symbols.Symbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().box()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses().contains + ( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def boxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx + ) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().box(), + ctx + ).symbol() + def unboxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx + ) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().unbox(), + ctx + ).symbol() + def safelyRemovableUnboxArg(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = { + val selector15: dotty.tools.dotc.ast.Trees.Tree = tree + { + def case81(): dotty.tools.dotc.ast.Trees.Tree = { + def case91(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail51(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector15) + { + { + dotty.tools.dotc.ast.tpd.EmptyTree() + } + } + } + if selector15.isInstanceOf[dotty.tools.dotc.ast.Trees.Apply] then + { + val x22: dotty.tools.dotc.ast.Trees.Apply = + selector15.asInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + { + val o101: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply( + selector15.asInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + ) + if o101.isDefined() then { + val x32: Tuple2 = o101.get().asInstanceOf[Tuple2] + { + val fn: dotty.tools.dotc.ast.Trees.Tree = + x32._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val p42: scala.collection.immutable.List = + x32._2().asInstanceOf[scala.collection.immutable.List] + if p42.isInstanceOf[scala.collection.immutable.::] then { + val x51: scala.collection.immutable.:: = + p42.asInstanceOf[scala.collection.immutable.::] + { + val o91: Option = + scala.package.::().unapply( + p42.asInstanceOf[scala.collection.immutable.::] + ) + if o91.isDefined() then { + val x61: Tuple2 = o91.get().asInstanceOf[Tuple2] + { + val arg: dotty.tools.dotc.ast.Trees.Tree = + x61._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees.Tree + ] + val p71: scala.collection.immutable.List = + x61._2().asInstanceOf[ + scala.collection.immutable.List + ] + if scala.package.Nil().equals(p71) then { + val x81: scala.collection.immutable.Nil$ = + p71.asInstanceOf[ + scala.collection.immutable.Nil$ + ] + { + if + dotty.tools.dotc.transform.Erasure.Boxing. + isUnbox + (fn.symbol(ctx), ctx).&&( + dotty.tools.dotc.core.Symbols.defn(ctx). + ScalaBoxedClasses + ().contains( + arg.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx).typeSymbol(ctx) + ) + ) + then { + arg + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + case81() + } + } + def constant(val tree: dotty.tools.dotc.ast.Trees.Tree, + val const: dotty.tools.dotc.ast.Trees.Tree + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree, ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.Trees.Tree = tree + scala.package.Nil().::($2$) + }, const, ctx) + def box(val tree: dotty.tools.dotc.ast.Trees.Tree, val target: Function0 + , + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + ctx.traceIndented({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["boxing ",": "," into ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree.showSummary(ctx) + },{ + tree.tpe() + },target.apply()] + ): + , ctx) + closure($anonfun:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + def $anonfun(): dotty.tools.dotc.ast.Trees.Tree = { + { + val selector16: dotty.tools.dotc.core.Types.Type = + tree.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type]. + widen + (ctx) + { + def case101(): dotty.tools.dotc.ast.Trees.Tree = { + def case111(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail61(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector16) + { + val tp: dotty.tools.dotc.core.Types.Type = selector16 + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass( + ) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant( + tree + , + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx). + BoxedUnit_UNIT + () + , ctx) + , ctx) + else + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx). + NothingClass + () + ) + then tree else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx). + ArrayClass + () + ) + ) + val arg: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree, ctx) + if arg.isEmpty() then + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + boxMethod + (cls.asClass(), ctx) + , ctx) + ).appliedTo(tree, ctx) + else { + ctx.log({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray( + ["boxing an unbox: "," -> ",""] + ): + ).s( + Predef.wrapRefArray( + [{ + tree.symbol(ctx) + },{ + arg.tpe().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + }] + ): + ) + closure($anonfun:Function0) + }) + arg + } + } + } + } + } + if + selector16.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x23: dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o52: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + ) + if o52.isDefined() then { + val x33: Tuple2 = o52.get().asInstanceOf[Tuple2] + { + val clazz: dotty.tools.dotc.core.Symbols.ClassSymbol + = + x33._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols.ClassSymbol + ] + { + val p43: dotty.tools.dotc.core.Types.Type = + x33._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx).typeRef(ctx) + , { + val $3$: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + cast + (tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + ( + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz, ctx) + , ctx) + , ctx) + scala.package.Nil().::($3$) + }, ctx) + } + } + } + } else case111() + } + } else case111() + } + case101() + } + } + } + closure($anonfun:Function0) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + def box$default$2(): String = "" + def unbox(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + ctx.traceIndented({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["unboxing ",": "," as a ",""]): + + ) + ).i( + Predef.wrapRefArray( + [{ + tree.showSummary(ctx) + },{ + tree.tpe() + },pt] + ): + , ctx) + closure($anonfun:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + def $anonfun(): dotty.tools.dotc.ast.Trees.Tree = { + { + val selector17: dotty.tools.dotc.core.Types.Type = pt + { + def case121(): dotty.tools.dotc.ast.Trees.Tree = { + def case131(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail71(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector17) + { + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass( + ) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant( + tree + , + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply( + scala.runtime.BoxedUnit$#UNIT + ) + , ctx) + , ctx) + else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx). + ArrayClass + () + ) + ) + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + unboxMethod + (cls.asClass(), ctx) + , ctx) + ).appliedTo(tree, ctx) + } + } + } + } + if + selector17.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x24: dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o41: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + ) + if o41.isDefined() then { + val x34: Tuple2 = o41.get().asInstanceOf[Tuple2] + { + val clazz: dotty.tools.dotc.core.Symbols.ClassSymbol + = + x34._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols.ClassSymbol + ] + val underlying: dotty.tools.dotc.core.Types.Type = + x34._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + { + val tree1: dotty.tools.dotc.ast.Trees.Tree = + if + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].isRef( + dotty.tools.dotc.core.Symbols.defn(ctx). + NullClass + () + , ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (underlying).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, underlying, ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.transform.Erasure.Boxing + . + adaptToType(tree, + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz, ctx).typeRef(ctx) + , ctx) + ).select( + dotty.tools.dotc.transform.ValueClasses. + valueClassUnbox + ( + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz, ctx) + , ctx) + , ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree1 + , pt, ctx) + } + } + } + } else case131() + } + } else case131() + } + case121() + } + } + } + closure($anonfun:Function0) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + def cast(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + def tailLabel11(val $this: dotty.tools.dotc.transform.Erasure.Boxing$ + , + val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + if + pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass(), ctx) + then dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt, ctx) + else + { + val selector18: Tuple2 = Tuple2.apply(tree.tpe(), pt) + { + def case141(): dotty.tools.dotc.ast.Trees.Tree = { + def case151(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail81(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector18) + { + { + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + , ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps(tree).asInstance(pt, + ctx + ) + } + } + } + { + val o111: Option = Tuple2.unapply(selector18) + if o111.isDefined() then { + val x25: Tuple2 = o111.get().asInstanceOf[Tuple2] + { + val p31: dotty.tools.dotc.core.Types.Type = + x25._1().asInstanceOf[dotty.tools.dotc.core.Types.Type + ] + val p44: dotty.tools.dotc.core.Types.Type = + x25._2().asInstanceOf[dotty.tools.dotc.core.Types.Type + ] + if + p31.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x52: dotty.tools.dotc.core.Types.JavaArrayType = + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o102: Option = + dotty.tools.dotc.core.Types.JavaArrayType.unapply( + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + ) + if o102.isDefined() then { + val x62: dotty.tools.dotc.core.Types.Type = + o102.get().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + val treeElem: dotty.tools.dotc.core.Types.Type + = + x62 + if + p44.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x71: + dotty.tools.dotc.core.Types.JavaArrayType + = + p44.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o92: Option = + dotty.tools.dotc.core.Types.JavaArrayType. + unapply + ( + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + JavaArrayType + ] + ) + if o92.isDefined() then { + val x82: dotty.tools.dotc.core.Types.Type + = + o92.get().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + val ptElem: + dotty.tools.dotc.core.Types.Type + = x82 + { + if + dotty.tools.dotc.transform.TypeUtils + . + decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform. + TypeUtils + .decorateTypeUtils(ptElem). + isPrimitiveValueType + (ctx).unary_!() + ) + then { + tailLabel11($this, + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols. + defn + (ctx).runtimeMethod( + dotty.tools.dotc.core. + StdNames + .nme().toObjectArray() + ) + , ctx) + ).appliedTo(tree, ctx) + , pt, ctx) + } else case151() + } + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } + case141() + } + } + } + tailLabel11(Boxing$.this, tree, pt, ctx) + } + def adaptToType(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + def tailLabel12(val $this: dotty.tools.dotc.transform.Erasure.Boxing$ + , + val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else { + val selector19: dotty.tools.dotc.core.Types.Type = + tree.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type].widen( + ctx + ) + { + def case161(): dotty.tools.dotc.ast.Trees.Tree = { + def case171(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail91(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector19) + { + val tpw: dotty.tools.dotc.core.Types.Type = selector19 + { + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType] + . + ||( + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].<:<(pt, ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(tree + , + { + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + () + closure($anonfun:Function0) + } + , ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box( + tree + , { + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + () + closure($anonfun:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, pt, ctx) + , pt, ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast + ( + tree, pt, ctx) + } + } + } + if + selector19.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x26: dotty.tools.dotc.core.Types.MethodType = + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o71: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o71.isDefined() then { + val x35: Tuple2 = o71.get().asInstanceOf[Tuple2] + { + val p45: scala.collection.immutable.List = + x35._1().asInstanceOf[ + scala.collection.immutable.List + ] + if scala.package.Nil().equals(p45) then { + val x63: scala.collection.immutable.Nil$ = + p45.asInstanceOf[scala.collection.immutable.Nil$] + { + val p51: scala.collection.immutable.List = + x35._2().asInstanceOf[ + scala.collection.immutable.List + ] + if tree.isTerm() then { + tailLabel12($this, + dotty.tools.dotc.ast.tpd.TreeOps(tree). + appliedToNone + (ctx) + , pt, ctx) + } else case171() + } + } else case171() + } + } else case171() + } + } else case171() + } + case161() + } + } + tailLabel12(Boxing$.this, tree, pt, ctx) + } + } + class Typer() extends dotty.tools.dotc.typer.ReTyper() with + dotty.tools.dotc.typer + .NoChecking { + def checkNonCyclic(val sym: dotty.tools.dotc.core.Symbols.Symbol, + val info: dotty.tools.dotc.core.Types.TypeBounds + , val reportErrors: Boolean, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = + Typer.super[NoChecking].checkNonCyclic(sym, info, reportErrors, ctx) + def checkValue(val tree: dotty.tools.dotc.ast.Trees.Tree, + val proto: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = Typer.super[NoChecking].checkValue(tree, proto, ctx) + def checkBounds(val args: scala.collection.immutable.List, + val poly: dotty.tools.dotc.core.Types.PolyType + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkBounds(args, poly, ctx) + def checkStable(val tp: dotty.tools.dotc.core.Types.Type, + val pos: dotty.tools.dotc.util.Positions.Position + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkStable(tp, pos, ctx) + def checkLegalPrefix(val tp: dotty.tools.dotc.core.Types.Type, + val selector: dotty.tools.dotc.core.Names.Name + , val pos: dotty.tools.dotc.util.Positions.Position, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = + Typer.super[NoChecking].checkLegalPrefix(tp, selector, pos, ctx) + def checkClassTypeWithStablePrefix( + val tp: dotty.tools.dotc.core.Types.Type + , val pos: dotty.tools.dotc.util.Positions.Position, + val traitReq: Boolean + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Types.Type + = + Typer.super[NoChecking].checkClassTypeWithStablePrefix(tp, pos, + traitReq + , ctx) + def checkImplicitParamsNotSingletons( + val vparamss: scala.collection.immutable.List + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkImplicitParamsNotSingletons(vparamss, ctx + ) + def checkFeasible(val tp: dotty.tools.dotc.core.Types.Type, + val pos: dotty.tools.dotc.util.Positions.Position + , val where: ()String, val ctx: dotty.tools.dotc.core.Contexts.Context) + : + dotty.tools.dotc.core.Types.Type = + Typer.super[NoChecking].checkFeasible(tp, pos, + where().asInstanceOf[Function0] + , ctx) + def checkNoDoubleDefs(val cls: dotty.tools.dotc.core.Symbols.Symbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = Typer.super[NoChecking].checkNoDoubleDefs(cls, ctx) + def checkFeasible$default$3(): String = + Typer.super[NoChecking].checkFeasible$default$3() + def erasedType(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = { + val selector110: dotty.tools.dotc.core.Types.Type = tree.typeOpt() + { + def case181(): dotty.tools.dotc.core.Types.Type = { + def case191(): dotty.tools.dotc.core.Types.Type = { + def matchFail101(): dotty.tools.dotc.core.Types.Type = + throw new MatchError(selector110) + { + val tp: dotty.tools.dotc.core.Types.Type = selector110 + { + dotty.tools.dotc.core.TypeErasure.erasure(tp, ctx) + } + } + } + if selector110.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val tp: dotty.tools.dotc.core.Types.TermRef = + selector110.asInstanceOf[dotty.tools.dotc.core.Types.TermRef] + { + if tree.isTerm() then { + dotty.tools.dotc.core.TypeErasure.erasedRef(tp, ctx) + } else case191() + } + } else case191() + } + case181() + } + } + def promote(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = { + assert(tree.hasType()) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree, ctx) + ctx.log({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray(["promoting ",": ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying( + erased.showWithUnderlying$default$1() + , ctx) + }] + ): + ) + closure($anonfun:Function0) + }) + tree.withType(erased, ctx) + } + def typedLiteral(val tree: dotty.tools.dotc.ast.Trees.Literal, + val ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Literal = + if + tree.typeOpt().isRef( + dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass() + , ctc) + then + tree.withType(tree.typeOpt(), ctc).asInstanceOf[ + dotty.tools.dotc.ast.Trees.Literal + ] + else super.typedLiteral(tree, ctc) + def typedSelect(val tree: dotty.tools.dotc.ast.Trees.Select, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).exists(), { + def $anonfun(): String = tree.show(ctx) + closure($anonfun:Function0) + }) + def select(val qual: dotty.tools.dotc.ast.Trees.Tree, + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.Trees.Tree = { + val name: dotty.tools.dotc.core.Names.Name = { + val selector111: dotty.tools.dotc.core.Types.Type = tree.typeOpt() + { + def case201(): dotty.tools.dotc.core.Names.Name = { + def case211(): dotty.tools.dotc.core.Names.Name = { + def matchFail111(): dotty.tools.dotc.core.Names.Name = + throw new MatchError(selector111) + { + { + sym.name(ctx) + } + } + } + if + selector111.isInstanceOf[ + dotty.tools.dotc.core.Types.NamedType + ] + then { + val tp: dotty.tools.dotc.core.Types.NamedType = + selector111.asInstanceOf[ + dotty.tools.dotc.core.Types.NamedType + ] + { + if + dotty.tools.dotc.core.NameOps.NameDecorator(tp.name()). + isInheritedName + () + then { + dotty.tools.dotc.core.NameOps.NameDecorator( + sym.name(ctx) + ).inheritedName() + } else case211() + } + } else case211() + } + case201() + } + } + dotty.tools.dotc.ast.untpd.cpy().Select(tree, qual, sym.name(ctx), + ctx + ).withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym( + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + , sym, ctx) + , ctx) + } + def selectArrayMember(val qual: dotty.tools.dotc.ast.Trees.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = { + def tailLabel14(val $this: dotty.tools.dotc.transform.Erasure.Typer + , + val qual: dotty.tools.dotc.ast.Trees.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + , ctx) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator(tree.name()). + genericArrayOp + () + , pt, Predef.wrapRefArray([qual]): , ctx) + else + if + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type].<:<( + erasedPre + , ctx).unary_!() + then + tailLabel14($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, + erasedPre + , ctx) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy().Select(tree, qual, + dotty.tools.dotc.core.NameOps.NameDecorator(tree.name()). + primitiveArrayOp + () + , ctx) + , qual, ctx) + tailLabel14(Typer.this, qual, erasedPre) + } + def adaptIfSuper(val qual: dotty.tools.dotc.ast.Trees.Tree): + dotty.tools.dotc.ast.Trees.Tree + = { + val selector113: dotty.tools.dotc.ast.Trees.Tree = qual + { + def case231(): dotty.tools.dotc.ast.Trees.Tree = { + def case241(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail131(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector113) + { + { + qual + } + } + } + if selector113.isInstanceOf[dotty.tools.dotc.ast.Trees.Super] + then + { + val x28: dotty.tools.dotc.ast.Trees.Super = + selector113.asInstanceOf[dotty.tools.dotc.ast.Trees.Super] + { + val o61: Option = + dotty.tools.dotc.ast.Trees.Super.unapply( + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Super + ] + ) + if o61.isDefined() then { + val x37: Tuple2 = o61.get().asInstanceOf[Tuple2] + { + val thisQual: dotty.tools.dotc.ast.Trees.Tree = + x37._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val p46: dotty.tools.dotc.core.Names.TypeName = + x37._2().asInstanceOf[ + dotty.tools.dotc.core.Names.TypeName + ] + if + dotty.tools.dotc.core.StdNames.tpnme().EMPTY().equals( + p46 + ) + then { + val x53: dotty.tools.dotc.core.Names.TypeName = + p46: dotty.tools.dotc.core.Names.TypeName + { + { + val $4$: Tuple2 = { + val selector112: + dotty.tools.dotc.core.Types.Type + = + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ]: dotty.tools.dotc.core.Types.Type + { + def case221(): Tuple2 = { + def matchFail121(): Tuple2 = + throw new MatchError(selector112) + if + selector112.isInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + then { + val x27: + dotty.tools.dotc.core.Types.SuperType + = + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + { + val o42: Option = + dotty.tools.dotc.core.Types.SuperType. + unapply + ( + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + SuperType + ] + ) + if o42.isDefined() then { + val x36: Tuple2 = + o42.get().asInstanceOf[Tuple2] + { + val thisType: + dotty.tools.dotc.core.Types.Type + = + x36._1().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + val supType: + dotty.tools.dotc.core.Types.Type + = + x36._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + Tuple2.apply(thisType, supType) + } + } + } else matchFail121() + } + } else matchFail121() + } + case221() + } + } + val thisType: dotty.tools.dotc.core.Types.Type = + $4$._1().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + val supType: dotty.tools.dotc.core.Types.Type = + $4$._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx + ) + .owner() + , ctx).is(dotty.tools.dotc.core.Flags.Trait(), + ctx + ) + then + dotty.tools.dotc.ast.tpd.cpy().Super(qual, + thisQual + , + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx + ) + .owner().asClass().name(ctx).asInstanceOf[ + dotty.tools.dotc.core.Names.TypeName + ] + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym + , + ctx).owner() + , ctx).typeRef(ctx) + , ctx) + , ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , thisType.firstParent(ctx), ctx) + , ctx) + } + } + } else case241() + } + } else case241() + } + } else case241() + } + case231() + } + } + def recur(val qual: dotty.tools.dotc.ast.Trees.Tree): + dotty.tools.dotc.ast.Trees.Tree + = { + def tailLabel16(val $this: dotty.tools.dotc.transform.Erasure.Typer + , + val qual: dotty.tools.dotc.ast.Trees.Tree): + dotty.tools.dotc.ast.Trees.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type]. + widen + (ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass() + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).isConstructor( + ) + , { + def $anonfun(): String = + StringContext.apply(Predef.wrapRefArray(["",""]): + ) + .s( + Predef.wrapRefArray( + [{ + sym.showLocated(ctx) + }] + ): + ) + closure($anonfun:Function0) + }) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + , ctx).info(ctx).decl(sym.name(ctx), ctx).symbol() + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!()).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + ).isErasedValueType(ctx) + ) + then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, { + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2( + ) + closure($anonfun:Function0) + }, ctx) + ) + else + if qualIsPrimitive.unary_!().&&(symIsPrimitive) then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner( + ) + , ctx).typeRef(ctx) + , ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner().eq + ( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass()) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier().typeOpt().widen(ctx).finalResultType( + ) + , ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.Trees.Tree = + adaptIfSuper(qual) + if + qual1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner( + ) + , ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.Trees.Super] + ) + then select(qual1, sym) else + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx). + owner + () + , ctx).typeRef(ctx) + , ctx) + ) + } + } + tailLabel16(Typer.this, qual) + } + recur( + Typer.this.typed(tree.qualifier(), + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + , ctx) + ) + } + def typedSelectFromTypeTree( + val tree: dotty.tools.dotc.ast.Trees.SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.Type, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name()).withPos(tree.pos()). + asInstanceOf + [dotty.tools.dotc.ast.Trees.Tree].withType( + Typer.this.erasedType(tree, ctx) + , ctx) + def typedThis(val tree: dotty.tools.dotc.ast.Trees.This, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx), ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree, ctx) else { + ctx.log({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["computing outer path from ","%, % to ",", encl class = " + , + ""] + ): + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + ownersIterator + (ctx).toList() + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + }] + ): + , ctx) + closure($anonfun:Function0) + }) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs(val name: dotty.tools.dotc.core.Names.Name + , + val pt: dotty.tools.dotc.core.Types.Type, val args: scala.collection.Seq + , + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: scala.collection.immutable.List = + dotty.tools.dotc.core.Symbols.toDenot(meth, ctx).info(ctx). + firstParamTypes + ().drop(args.length()) + val followingArgs: scala.collection.immutable.List = + dotty.tools.dotc.core.Decorators.ListDecorator( + Typer.this.protoArgs(pt) + ).zipWithConserve(followingParams, { + def $anonfun(tree: dotty.tools.dotc.ast.Trees.Tree, + pt: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = + Typer.this.typedExpr(tree, pt, ctx) + closure($anonfun) + }): scala.collection.immutable.List + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + , ctx) + ).appliedToArgs( + args.toList().++(followingArgs, + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + , ctx) + } + def protoArgs(val pt: dotty.tools.dotc.core.Types.Type): + scala.collection.immutable.List + = { + val selector114: dotty.tools.dotc.core.Types.Type = pt + { + def case251(): scala.collection.immutable.List = { + def case261(): scala.collection.immutable.List = { + def matchFail141(): scala.collection.immutable.List = + throw new MatchError(selector114) + { + { + scala.package.Nil() + } + } + } + if + selector114.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto + ] + then { + val pt: dotty.tools.dotc.typer.ProtoTypes.FunProto = + selector114.asInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto + ] + { + { + pt.args().++(Typer.this.protoArgs(pt.resultType()), + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + } + } + } else case261() + } + case251() + } + } + def typedTypeApply(val tree: dotty.tools.dotc.ast.Trees.TypeApply, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val ntree: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree: dotty.tools.dotc.ast.Trees.TypeApply + , ctx) + { + val selector116: dotty.tools.dotc.ast.Trees.Tree = ntree + { + def case291(): dotty.tools.dotc.ast.Trees.Tree = { + def case301(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail161(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector116) + { + { + Typer.this.typedExpr(ntree, pt, ctx) + } + } + } + if + selector116.isInstanceOf[dotty.tools.dotc.ast.Trees.TypeApply] + then { + val x29: dotty.tools.dotc.ast.Trees.TypeApply = + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply + ] + { + val o43: Option = + dotty.tools.dotc.ast.Trees.TypeApply.unapply( + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply + ] + ) + if o43.isDefined() then { + val x38: Tuple2 = o43.get().asInstanceOf[Tuple2] + { + val fun: dotty.tools.dotc.ast.Trees.Tree = + x38._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val args: scala.collection.immutable.List = + x38._2().asInstanceOf[scala.collection.immutable.List] + { + { + val fun1: dotty.tools.dotc.ast.Trees.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + , ctx) + { + val selector115: dotty.tools.dotc.core.Types.Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx) + { + def case271(): dotty.tools.dotc.ast.Trees.Tree + = + { + def case281(): dotty.tools.dotc.ast.Trees.Tree + = + { + def matchFail151(): + dotty.tools.dotc.ast.Trees.Tree + = throw new MatchError(selector115) + { + { + fun1 + } + } + } + if + selector115.isInstanceOf[ + dotty.tools.dotc.core.Types.PolyType + ] + then { + val funTpe: + dotty.tools.dotc.core.Types.PolyType + = + selector115.asInstanceOf[ + dotty.tools.dotc.core.Types.PolyType + ] + { + { + val args1: + scala.collection.immutable.List + = + dotty.tools.dotc.core.Decorators. + ListDecorator + (args).mapconserve({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree + ): dotty.tools.dotc.ast.Trees.Tree + = + Typer.this.typedType(_$1, + Typer.this.typedType$default$2() + , ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy(). + TypeApply + (tree, fun1, args1, ctx).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd. + ListOfTreeDecorator + (args1).tpes() + , ctx) + , ctx) + } + } + } else case281() + } + case271() + } + } + } + } + } + } else case301() + } + } else case301() + } + case291() + } + } + } + def typedApply(val tree: dotty.tools.dotc.ast.Trees.Apply, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val $5$: Tuple2 = { + val selector117: dotty.tools.dotc.ast.Trees.Apply = + tree: dotty.tools.dotc.ast.Trees.Apply + { + def case311(): Tuple2 = { + def matchFail171(): Tuple2 = throw new MatchError(selector117) + { + val o31: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply(selector117) + if o31.isDefined() then { + val x210: Tuple2 = o31.get().asInstanceOf[Tuple2] + { + val fun: dotty.tools.dotc.ast.Trees.Tree = + x210._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val args: scala.collection.immutable.List = + x210._2().asInstanceOf[scala.collection.immutable.List] + { + Tuple2.apply(fun, args) + } + } + } else matchFail171() + } + } + case311() + } + } + val fun: dotty.tools.dotc.ast.Trees.Tree = + $5$._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val args: scala.collection.immutable.List = + $5$._2().asInstanceOf[scala.collection.immutable.List] + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply() + ) + then + Typer.this.typedUnadapted( + args.head().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + , pt, ctx) + else { + val selector119: dotty.tools.dotc.ast.Trees.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this + , + ctx) + , ctx) + { + def case341(): dotty.tools.dotc.ast.Trees.Apply = { + def case351(): dotty.tools.dotc.ast.Trees.Apply = { + def matchFail191(): dotty.tools.dotc.ast.Trees.Apply = + throw new MatchError(selector119) + { + val fun1: dotty.tools.dotc.ast.Trees.Tree = selector119 + { + { + val selector118: dotty.tools.dotc.core.Types.Type = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx) + { + def case321(): dotty.tools.dotc.ast.Trees.Apply = { + def case331(): dotty.tools.dotc.ast.Trees.Apply = { + def matchFail181(): + dotty.tools.dotc.ast.Trees.Apply + = throw new MatchError(selector118) + { + { + throw + new MatchError( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + Predef.wrapRefArray( + ["tree ", + " has unexpected type of function " + ,", was ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [tree,{ + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx) + },{ + fun.typeOpt().widen(ctx) + }] + ): + , ctx) + ) + } + } + } + if + selector118.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val mt: dotty.tools.dotc.core.Types.MethodType = + selector118.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + { + val outers: scala.collection.immutable.List = + dotty.tools.dotc.transform.ExplicitOuter. + outer + (ctx).args( + fun: dotty.tools.dotc.ast.Trees.Tree + ) + val args1: scala.collection.immutable.List = + { + val $6$: scala.collection.immutable.List + = + outers + dotty.tools.dotc.core.Decorators. + ListDecorator + ( + args.++(Typer.this.protoArgs(pt), + scala.collection.immutable.List. + canBuildFrom + () + ).asInstanceOf[ + scala.collection.immutable.List + ].:::($6$) + ) + }.zipWithConserve(mt.paramTypes(), { + def $anonfun( + tree: dotty.tools.dotc.ast.Trees.Tree + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree + = Typer.this.typedExpr(tree, pt, ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy().Apply(tree, + fun1 + , args1, ctx).withType(mt.resultType(), ctx). + asInstanceOf + [dotty.tools.dotc.ast.Trees.Apply] + } + } + } else case331() + } + case321() + } + } + } + } + } + if selector119.isInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + then + { + val fun1: dotty.tools.dotc.ast.Trees.Apply = + selector119.asInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + { + { + fun1 + } + } + } else case351() + } + case341() + } + } + } + def typedSeqLiteral(val tree: dotty.tools.dotc.ast.Trees.SeqLiteral, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.SeqLiteral + = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt(), ctx) + , ctx) + def typedValDef(val vdef: dotty.tools.dotc.ast.Trees.ValDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName = + dotty.tools.dotc.ast.untpd.cpy().ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2(), ctx).withPos( + vdef.tpt().pos() + ).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + ) + val rhs$1: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.ast.untpd.cpy().ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy().ValDef(vdef, name$3, tpt$1, rhs$1) + }, sym, ctx) + def typedDefDef(val ddef: dotty.tools.dotc.ast.Trees.DefDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx).resultType + ( + ) + val ddef1: dotty.tools.dotc.ast.Trees.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName = + dotty.tools.dotc.ast.untpd.cpy().DefDef$default$2(ddef) + val vparamss$1: scala.collection.immutable.List = { + val $7$: scala.collection.immutable.List = + ddef.vparamss().flatten($conforms()).asInstanceOf[ + scala.collection.immutable.List + ] + scala.package.Nil().::($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2() + , ctx).withPos(ddef.tpt().pos()).asInstanceOf[ + dotty.tools.dotc.ast.Trees.Tree + ] + ) + val rhs$2: dotty.tools.dotc.ast.Trees.Tree = { + val selector120: dotty.tools.dotc.ast.Trees.Tree = ddef.rhs() + { + def case361(): dotty.tools.dotc.ast.Trees.Tree = { + def case371(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail201(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector120) + { + { + ddef.rhs() + } + } + } + if selector120.isInstanceOf[dotty.tools.dotc.ast.Trees.Ident] + then + { + val x211: dotty.tools.dotc.ast.Trees.Ident = + selector120.asInstanceOf[dotty.tools.dotc.ast.Trees.Ident] + { + val o62: Option = + dotty.tools.dotc.ast.Trees.Ident.unapply( + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident + ] + ) + if o62.isDefined() then { + val x39: dotty.tools.dotc.core.Names.Name = + o62.get().asInstanceOf[ + dotty.tools.dotc.core.Names.Name + ] + { + val p47: dotty.tools.dotc.core.Names.Name = x39 + if + dotty.tools.dotc.core.StdNames.nme().WILDCARD(). + equals + (p47) + then { + val x54: dotty.tools.dotc.core.Names.TermName = + p47.asInstanceOf[ + dotty.tools.dotc.core.Names.TermName + ] + { + val id: dotty.tools.dotc.ast.Trees.Ident = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident + ] + { + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe, ctx) + ) + } + } + } else case371() + } + } else case371() + } + } else case371() + } + case361() + } + } + dotty.tools.dotc.ast.untpd.cpy().DefDef(ddef, name$4, + scala.package.Nil() + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym, ctx) + } + def typedTypeDef(val tdef: dotty.tools.dotc.ast.Trees.TypeDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree() + def typedStats(val stats: scala.collection.immutable.List, + val exprOwner: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List + = { + val stats1: scala.collection.immutable.List = + dotty.tools.dotc.ast.Trees.flatten( + super.typedStats(stats, exprOwner, ctx) + ) + if ctx.owner().isClass() then { + val $8$: scala.collection.immutable.List = stats1 + Typer.this.addBridges(stats, stats1, ctx).:::($8$) + } else stats1 + } + def addBridges(val oldStats: scala.collection.immutable.List, + val newStats: scala.collection.immutable.List + , val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List + = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase() + ) + def traverse(val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + def tailLabel30(val $this: dotty.tools.dotc.transform.Erasure.Typer + , + val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + { + val selector123: scala.collection.immutable.List = after + { + def case431(): scala.collection.immutable.List = { + def case441(): scala.collection.immutable.List = { + def case451(): scala.collection.immutable.List = { + def matchFail231(): scala.collection.immutable.List = + throw new MatchError(selector123) + if + selector123.isInstanceOf[scala.collection.immutable.:: + ] + then { + val x65: scala.collection.immutable.:: = + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o82: Option = + scala.package.::().unapply( + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o82.isDefined() then { + val x73: Tuple2 = o82.get().asInstanceOf[Tuple2] + { + val newTail: scala.collection.immutable.List = + x73._2().asInstanceOf[ + scala.collection.immutable.List + ] + { + { + tailLabel30($this, newTail, before, + traverse$default$3() + ) + } + } + } + } else matchFail231() + } + } else matchFail231() + } + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x312: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.:: + ] + { + val o94: Option = + scala.package.::().unapply( + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o94.isDefined() then { + val x43: Tuple2 = o94.get().asInstanceOf[Tuple2] + { + val pi52: dotty.tools.dotc.ast.Trees.Tree = + x43._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees.Tree + ] + val newTail: scala.collection.immutable.List = + x43._2().asInstanceOf[ + scala.collection.immutable.List + ] + if + pi52.isInstanceOf[ + dotty.tools.dotc.ast.Trees.DefDef + ] + then { + val member: dotty.tools.dotc.ast.Trees.DefDef = + pi52.asInstanceOf[ + dotty.tools.dotc.ast.Trees.DefDef + ] + { + { + { + val selector122: + scala.collection.immutable.List + = before + { + def case401(): + scala.collection.immutable.List + = { + def case411(): + scala.collection.immutable.List + = { + def case421(): + scala.collection.immutable.List + = { + def matchFail221(): + scala.collection.immutable.List + = + throw + new MatchError(selector122) + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x64: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable. + :: + ] + { + val o81: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable + . + :: + ] + ) + if o81.isDefined() then { + val x72: Tuple2 = + o81.get().asInstanceOf[ + Tuple2 + ] + { + val oldTail: + scala.collection.immutable + . + List + = + x72._2().asInstanceOf[ + scala.collection.immutable + . + List + ] + { + { + tailLabel30($this, + after + , oldTail, + traverse$default$3() + ) + } + } + } + } else matchFail221() + } + } else matchFail221() + } + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x311: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o93: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable + . + :: + ] + ) + if o93.isDefined() then { + val x42: Tuple2 = + o93.get().asInstanceOf[ + Tuple2 + ] + { + val pi51: + dotty.tools.dotc.ast.Trees + . + Tree + = + x42._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees + . + Tree + ] + val oldTail: + scala.collection.immutable + . + List + = + x42._2().asInstanceOf[ + scala.collection.immutable + . + List + ] + if + pi51.isInstanceOf[ + dotty.tools.dotc.ast.Trees + . + DefDef + ] + then { + val oldMember: + dotty.tools.dotc.ast.Trees + . + DefDef + = + pi51.asInstanceOf[ + dotty.tools.dotc.ast.Trees + . + DefDef + ] + { + { + val oldSymbol: + dotty.tools.dotc.core.Symbols + . + Symbol + = + oldMember.symbol( + beforeCtx + ) + val newSymbol: + dotty.tools.dotc.core.Symbols + . + Symbol + = member.symbol(ctx) + assert( + oldSymbol.name( + beforeCtx + ).==( + newSymbol.name(ctx + ) + ) + , { + def $anonfun(): + String + = + StringContext. + apply + ( + Predef. + wrapRefArray + ( + ["", + " bridging with " + ,""] + ): + ).s( + Predef. + wrapRefArray + ( + [{ + oldSymbol. + name + (beforeCtx) + },{ + newSymbol. + name + (ctx) + }] + ): + ) + closure($anonfun: + Function0 + ) + }) + val newOverridden: + scala.collection.immutable + . + Set + = + oldSymbol.denot(ctx) + . + allOverriddenSymbols + ( + ctx).toSet() + val oldOverridden: + scala.collection.immutable + . + Set + = + dotty.tools.dotc. + core + .Symbols.toDenot( + newSymbol + , ctx). + allOverriddenSymbols + (beforeCtx).toSet() + def stillInBaseClass( + val sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean = + dotty.tools.dotc. + core + .Symbols.toDenot( + ctx.owner() + , ctx).derivesFrom( + dotty.tools.dotc. + core + .Symbols.toDenot( + sym + , ctx).owner() + , ctx) + val neededBridges: + scala.collection.immutable + . + Set + = + oldOverridden.--( + newOverridden + ).asInstanceOf[ + scala.collection. + TraversableLike + ].filter({ + def $anonfun( + val sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean = + stillInBaseClass + ( + sym) + closure($anonfun) + }).asInstanceOf[ + scala.collection.immutable + . + Set + ] + val minimalSet: + scala.collection.immutable + . + Set + = + Set().apply( + Predef. + genericWrapArray + ([]): + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + neededBridges.foreach( + { + def $anonfun( + val bridge: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Unit = { + val isRequired: + Boolean + = + minimalSet. + forall + ({ + def $anonfun( + nxtBridge: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean = + dotty.tools.dotc + . + core.Symbols + . + toDenot( + bridge + , ctx).info( + ctx + ).=:=( + dotty.tools.dotc + . + core. + Symbols + .toDenot( + nxtBridge + , ctx). + info + (ctx) + , ctx). + unary_! + () + closure( + $anonfun + ) + }) + if isRequired then + + { + val clash: + Option + = + dotty.tools.dotc + . + core.Symbols. + toDenot + ( + dotty.tools.dotc + . + core.Symbols + . + toDenot( + oldSymbol + , ctx).owner + ( + ) + , ctx).decls( + ctx + ).lookupAll( + bridge.name( + ctx + ) + , ctx).find({ + { + def + $anonfun + ( + sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean + = + { + sym.name + ( + ctx).eq( + bridge + . + name( + ctx + ) + ).&&( + dotty.tools.dotc + . + core. + Symbols + . + toDenot + (sym, + ctx + ).info + ( + ctx). + widen + (ctx). + =:= + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + , + ctx + ). + info + (ctx + ) + . + widen + ( + ctx) + , ctx) + ) + } + closure( + $anonfun + ) + } + }).orElse({ + def $anonfun + ( + ): Option = + emittedBridges + . + find({ + def + $anonfun + ( + val + stat + : + dotty.tools.dotc.ast.Trees + . + DefDef + ): + Boolean + = + stat. + name + ().==( + bridge + . + name + ( + ctx) + ).&&( + stat + . + tpe( + ) + . + asInstanceOf + [ + dotty.tools.dotc.core.Types + . + Type + ] + . + widen + ( + ctx) + . + =:=( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + , + ctx + ) + . + info + ( + ctx + ) + . + widen + ( + ctx + ) + , + ctx + ) + ) + closure( + $anonfun + ) + }).map({ + def + $anonfun + ( + val + _$2 + : + dotty.tools.dotc.ast.Trees + . + DefDef + ): + dotty.tools.dotc.core.Symbols + . + Symbol + = + _$2. + symbol + (ctx) + closure( + $anonfun + ) + }) + closure( + $anonfun + :Function0) + }) + { + val + selector121 + : Option = + clash + { + def case381( + ) + : Unit = { + def + case391 + (): Unit + = + { + def + matchFail211 + (): Unit + = + throw + new + MatchError + ( + selector121 + ) + if + None. + equals + ( + selector121 + ) + then { + val + x41 + : + None$ + = + selector121 + . + asInstanceOf + [ + None$] + { + { + minimalSet + = + minimalSet + . + +( + bridge + ). + asInstanceOf + [ + scala.collection.immutable + . + Set + ] + } + } + } else + matchFail211 + ( + ) + } + if + selector121 + . + isInstanceOf + [ + Some] + then { + val x212 + : + Some = + selector121 + . + asInstanceOf + [ + Some] + { + val + o53 + : + Option + = + Some. + unapply + ( + selector121 + . + asInstanceOf + [ + Some + ] + ) + if + o53. + isDefined + () + then + { + val + x310 + : + dotty.tools.dotc.core.Symbols + . + Symbol + = + o53. + get + (). + asInstanceOf + [ + dotty.tools.dotc.core.Symbols + . + Symbol + ] + { + val + + cl + : + dotty.tools.dotc.core.Symbols + . + Symbol + = + x310 + { + { + ctx + . + error + ( + { + def + + $anonfun + ( + ) + : + String + = + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + ( + [ + "bridge for method " + , + " of type " + , + "\\n" + ] + ) + : + + ) + ) + . + i + ( + Predef + . + wrapRefArray + ( + [ + { + newSymbol + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + newSymbol + , + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + ) + : + + , + ctx + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + ( + [ + "clashes with " + , + " of type " + , + "\\n" + ] + ) + : + + ) + ) + . + i + ( + Predef + . + wrapRefArray + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + , + ctx + ) + . + symbol + ( + ) + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + , + ctx + ) + . + symbol + ( + ) + , + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + ) + : + + , + ctx + ) + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + ( + [ + "both have same type after erasure: " + , + "" + ] + ) + : + + ) + ) + . + i + ( + Predef + . + wrapRefArray + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + , + ctx + ) + . + symbol + ( + ) + , + ctx + ) + . + info + ( + ctx + ) + } + ] + ) + : + + , + ctx + ) + ) + closure( + $anonfun + : + Function0 + ) + } + , + ctx + . + error$default$2 + ( + ) + ) + } + } + } + } + else + case391 + ( + ) + } + } else + case391( + ) + } + case381() + } + } + } + else () + } + closure($anonfun) + }) + val + bridgeImplementations + : + scala.collection.immutable + . + Set + = + minimalSet.map({ + { + def $anonfun( + sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): + dotty.tools.dotc.ast.Trees + . + DefDef + = { + $this. + makeBridgeDef + (member, sym, + ctx + ) + } + closure($anonfun + ) + } + }, + scala.collection.immutable + . + Set.canBuildFrom() + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + emittedBridges.++=( + bridgeImplementations + ) + tailLabel30($this, + newTail + , oldTail, + traverse$default$3() + ) + } + } + } else case421() + } + } else case421() + } + } else case421() + } + if + scala.package.Nil().equals( + selector122 + ) + then { + val x213: + scala.collection.immutable.Nil$ + = + selector122.asInstanceOf[ + scala.collection.immutable.Nil$ + ] + { + { + emittedBridges.toList() + } + } + } else case411() + } + case401() + } + } + } + } + } else case451() + } + } else case451() + } + } else case451() + } + if scala.package.Nil().equals(selector123) then { + val x214: scala.collection.immutable.Nil$ = + selector123.asInstanceOf[scala.collection.immutable.Nil$ + ] + { + { + emittedBridges.toList() + } + } + } else case441() + } + case431() + } + } + } + tailLabel30(Typer.this, after, before, emittedBridges) + } + def traverse$default$3(): scala.collection.mutable.ListBuffer = + collection.mutable.ListBuffer.apply( + Predef.genericWrapArray([]): + ).asInstanceOf[scala.collection.mutable.ListBuffer] + traverse(newStats, oldStats, traverse$default$3()) + } + def makeBridgeDef(val newDef: dotty.tools.dotc.ast.Trees.DefDef, + val parentSym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef + = { + def error(val reason: String): Nothing = { + assert(false, { + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray( + ["failure creating bridge from "," to ",", reason: ",""] + ): + ).s( + Predef.wrapRefArray( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason] + ): + ) + closure($anonfun:Function0) + }) + ???() + } + val bridge: dotty.tools.dotc.core.Symbols.Symbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + () + val name$5: dotty.tools.dotc.core.Names.Name = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge()) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).info(ctx) + val privateWithin$2: dotty.tools.dotc.core.Symbols.Symbol = + ctx.newSymbol$default$5() + ctx.newSymbol(owner$3, name$5, flags$1, info$3, privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().coord() + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase().prev().asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + , ctx) + ctx.debuglog({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray(["generating bridge from "," to ",""]): + + ).s( + Predef.wrapRefArray( + [{ + newDef.symbol(ctx) + },bridge] + ): + ) + closure($anonfun:Function0) + }) + val sel: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().asClass() + , ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + termRef + (ctx) + , ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge, ctx).info(ctx).widen( + ctx + ).resultType() + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun(val paramss: scala.collection.immutable.List): + dotty.tools.dotc.ast.Trees.Tree + = { + val rhs: dotty.tools.dotc.ast.Trees.Tree = + paramss.foldLeft(sel, { + def $anonfun(fun: dotty.tools.dotc.ast.Trees.Tree, + vparams: scala.collection.immutable.List + ): dotty.tools.dotc.ast.Trees.Tree = { + val selector124: dotty.tools.dotc.core.Types.Type = + fun.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + . + widen(ctx) + { + def case461(): dotty.tools.dotc.ast.Trees.Apply = { + def case471(): dotty.tools.dotc.ast.Trees.Apply = { + def matchFail241(): dotty.tools.dotc.ast.Trees.Apply + = + throw new MatchError(selector124) + { + val a: dotty.tools.dotc.core.Types.Type = + selector124 + { + error( + StringContext.apply( + Predef.wrapRefArray( + ["can not resolve apply type ",""] + ): + ).s(Predef.wrapRefArray([a]): ) + ) + } + } + } + if + selector124.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x215: dotty.tools.dotc.core.Types.MethodType = + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o44: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o44.isDefined() then { + val x313: Tuple2 = + o44.get().asInstanceOf[Tuple2] + { + val types: scala.collection.immutable.List = + x313._2().asInstanceOf[ + scala.collection.immutable.List + ] + { + { + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps( + Tuple2.apply(vparams, types) + ).zipped($conforms(), $conforms()).map({ + def $anonfun( + _$3: dotty.tools.dotc.ast.Trees.Tree + , + _$4: + dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd. + EmptyTree + () + , ctx) + closure($anonfun) + }, + scala.collection.immutable.List. + canBuildFrom + () + ).asInstanceOf[ + scala.collection.immutable.List + ] + , ctx) + } + } + } + } else case471() + } + } else case471() + } + case461() + } + } + closure($anonfun) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3(), + ctx + ) + } + closure($anonfun) + } + }, ctx) + } + def adapt(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val original: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = { + val printer$1: dotty.tools.dotc.config.Printers.Printer = + ctx.traceIndented$default$2() + ctx.traceIndented({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["adapting ",": "," to ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree.showSummary(ctx) + },{ + tree.tpe() + },pt] + ): + , ctx) + closure($anonfun:Function0) + }, printer$1, true, { + def $anonfun(): dotty.tools.dotc.ast.Trees.Tree = { + assert( + ctx.phase().==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx). + erasurePhase + ().next() + ) + , { + def $anonfun(): dotty.tools.dotc.core.Phases.Phase = ctx.phase() + closure($anonfun:Function0) + }) + if tree.isEmpty() then tree else + if ctx.mode().is(dotty.tools.dotc.typer.Mode.Pattern()) then + tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt + , + ctx) + } + closure($anonfun:Function0) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + } + } + val Typer: dotty.tools.dotc.transform.Erasure.Typer$ = + new dotty.tools.dotc.transform.Erasure.Typer$() + class Typer$() extends Object() { + this: dotty.tools.dotc.transform.Erasure.Typer$ => + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after TreeTransform:{mixin, memoize, capturedVars, constructors}: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure extends dotty.tools.dotc.util.DotClass with + dotty.tools.dotc.core.Phases + .Phase with dotty.tools.dotc.core.DenotTransformers.DenotTransformer { + thisTransformer: dotty.tools.dotc.transform.Erasure => + + def (): dotty.tools.dotc.transform.Erasure = { + Erasure.super() + Erasure.super[Phase]() + Erasure.super[DenotTransformer]() + Erasure.this.eraser$$local = + new dotty.tools.dotc.transform.Erasure.Typer() + () + } + def myPeriod(): dotty.tools.dotc.core.Periods.Period = + Erasure.super[Phase].initial$myPeriod() + def myBase(): dotty.tools.dotc.core.Contexts.ContextBase = + Erasure.super[Phase].initial$myBase() + def myErasedTypes(): Boolean = + Erasure.super[Phase].initial$myErasedTypes() + def myFlatClasses(): Boolean = + Erasure.super[Phase].initial$myFlatClasses() + def myRefChecked(): Boolean = Erasure.super[Phase].initial$myRefChecked() + def mySymbolicRefs(): Boolean = + Erasure.super[Phase].initial$mySymbolicRefs() + def myPeriod_=(val x$1: dotty.tools.dotc.core.Periods.Period): Unit = () + def myBase_=(val x$1: dotty.tools.dotc.core.Contexts.ContextBase): Unit = + () + def myErasedTypes_=(val x$1: Boolean): Unit = () + def myFlatClasses_=(val x$1: Boolean): Unit = () + def myRefChecked_=(val x$1: Boolean): Unit = () + def mySymbolicRefs_=(val x$1: Boolean): Unit = () + def toString(): String = Erasure.super[Phase].toString() + def phaseName(): String = "erasure" + def runsAfter(): scala.collection.immutable.Set = + Set().apply( + Predef.wrapRefArray([classOf(),classOf(),classOf()]): + ).asInstanceOf[scala.collection.immutable.Set] + def transform(val ref: dotty.tools.dotc.core.Denotations.SingleDenotation + , + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Denotations.SingleDenotation + = { + val selector12: dotty.tools.dotc.core.Denotations.SingleDenotation = ref + { + def case21(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def case31(): dotty.tools.dotc.core.Denotations.SingleDenotation = { + def matchFail21(): + dotty.tools.dotc.core.Denotations.SingleDenotation + = throw new MatchError(selector12) + { + val ref: dotty.tools.dotc.core.Denotations.SingleDenotation = + selector12 + { + ref.derivedSingleDenotation(ref.symbol(), + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx), + ctx + ) + , ctx) + } + } + } + if + selector12.isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ] + then { + val ref: dotty.tools.dotc.core.SymDenotations.SymDenotation = + selector12.asInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ] + { + { + assert(ctx.phase().==(this), { + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray(["transforming "," at ",""]): + + ).s( + Predef.wrapRefArray( + [ref,{ + ctx.phase().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + }] + ): + ) + closure($anonfun:Function0) + }) + if + ref.symbol().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + ) + then { + val $1$: Tuple4 = { + val selector11: dotty.tools.dotc.core.Types.Type = + ref.info(ctx): dotty.tools.dotc.core.Types.Type + { + def case11(): Tuple4 = { + def matchFail11(): Tuple4 = + throw new MatchError(selector11) + if + selector11.isInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + then { + val x21: dotty.tools.dotc.core.Types.ClassInfo = + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + { + val o51: Option = + dotty.tools.dotc.core.Types.ClassInfo.unapply( + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types.ClassInfo + ] + ) + if o51.isDefined() then { + val x31: Tuple5 = o51.get().asInstanceOf[Tuple5] + { + val pre: dotty.tools.dotc.core.Types.Type = + x31._1().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + val ps: scala.collection.immutable.List = + x31._3().asInstanceOf[ + scala.collection.immutable.List + ] + val decls: dotty.tools.dotc.core.Scopes.Scope + = + x31._4().asInstanceOf[ + dotty.tools.dotc.core.Scopes.Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass + = + x31._5().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + { + val p41: + dotty.tools.dotc.core.Symbols.ClassSymbol + = + x31._2().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + ClassSymbol + ] + Tuple4.apply(pre, ps, decls, selfInfo) + } + } + } else matchFail11() + } + } else matchFail11() + } + case11() + } + } + val pre: dotty.tools.dotc.core.Types.Type = + $1$._1().asInstanceOf[dotty.tools.dotc.core.Types.Type] + val ps: scala.collection.immutable.List = + $1$._2().asInstanceOf[scala.collection.immutable.List] + val decls: dotty.tools.dotc.core.Scopes.Scope = + $1$._3().asInstanceOf[dotty.tools.dotc.core.Scopes.Scope] + val selfInfo: dotty.tools.dotc.util.DotClass = + $1$._4().asInstanceOf[dotty.tools.dotc.util.DotClass] + val extendedScope: dotty.tools.dotc.core.Scopes.MutableScope + = + decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + , ctx).classInfo(ctx).decls().foreach({ + def $anonfun(sym: dotty.tools.dotc.core.Symbols.Symbol): + dotty.tools.dotc.core.Symbols.Symbol + = extendedScope.enter(sym, ctx) + closure($anonfun) + }) + { + val symbol$1: dotty.tools.dotc.core.Symbols.Symbol = + ref.copySymDenotation$default$1() + val owner$1: dotty.tools.dotc.core.Symbols.Symbol = + ref.copySymDenotation$default$2() + val name$1: dotty.tools.dotc.core.Names.Name = + ref.copySymDenotation$default$3() + val initFlags$1: dotty.tools.dotc.core.Flags.FlagSet = + ref.copySymDenotation$default$4() + val info$1: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass( + ) + , ps, extendedScope, selfInfo, ctx) + , ctx) + val privateWithin$1: dotty.tools.dotc.core.Symbols.Symbol + = + ref.copySymDenotation$default$6() + val annotations$1: scala.collection.immutable.List = + ref.copySymDenotation$default$7() + ref.copySymDenotation(symbol$1, owner$1, name$1, + initFlags$1 + , info$1, privateWithin$1, annotations$1, ctx) + } + } else { + val oldOwner: dotty.tools.dotc.core.Symbols.Symbol = + ref.owner() + val newOwner: dotty.tools.dotc.core.Symbols.Symbol = + if + oldOwner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + ) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + else oldOwner + val oldInfo: dotty.tools.dotc.core.Types.Type = + ref.info(ctx) + val newInfo: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , oldInfo, ctx) + val oldFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx) + val newFlags: dotty.tools.dotc.core.Flags.FlagSet = + ref.flags(ctx).&~( + dotty.tools.dotc.core.Flags.HasDefaultParams() + ) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass(), ctx). + unary_! + () + , { + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray( + ["trans "," @ "," oldOwner = ",", newOwner = ", + ", oldInfo = " + ,", newInfo = "," "," ",""] + ): + ).s( + Predef.genericWrapArray( + [ref,{ + ctx.phase() + },oldOwner,newOwner,oldInfo,newInfo,{ + scala.Boolean.box(oldOwner.eq(newOwner)) + },{ + scala.Boolean.box(oldInfo.eq(newInfo)) + }] + ): + ) + closure($anonfun:Function0) + }) + { + val symbol$2: dotty.tools.dotc.core.Symbols.Symbol = + ref.copySymDenotation$default$1() + val owner$2: dotty.tools.dotc.core.Symbols.Symbol = + newOwner + val name$2: dotty.tools.dotc.core.Names.Name = + ref.copySymDenotation$default$3() + val initFlags$2: dotty.tools.dotc.core.Flags.FlagSet = + newFlags + val info$2: dotty.tools.dotc.core.Types.Type = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, + initFlags$2 + , info$2, ref.copySymDenotation$default$6(), + ref.copySymDenotation$default$7() + , ctx) + } + } + } + } + } + } else case31() + } + case21() + } + } + val eraser$$local: dotty.tools.dotc.transform.Erasure.Typer + def eraser(): dotty.tools.dotc.transform.Erasure.Typer = + Erasure.this.eraser$$local + def run(val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit() + unit.tpdTree_=( + Erasure.this.eraser().typedExpr(unit.tpdTree(), + Erasure.this.eraser().typedExpr$default$2() + , ctx.fresh().setPhase(this.next())) + ) + } + def checkPostCondition(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree, ctx) + { + val selector13: dotty.tools.dotc.ast.Trees.Tree = tree + { + def case41(): Unit = { + def case51(): Unit = { + def matchFail31(): Unit = throw new MatchError(selector13) + { + { + () + } + } + } + if selector13.isInstanceOf[dotty.tools.dotc.ast.Trees.This] then { + val res: dotty.tools.dotc.ast.Trees.This = + selector13.asInstanceOf[dotty.tools.dotc.ast.Trees.This] + { + { + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + , res, ctx).unary_!() + , { + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["Reference to "," from ",""]): + + ) + ).i( + Predef.wrapRefArray( + [res,{ + ctx.owner().showLocated(ctx) + }] + ): + , ctx) + closure($anonfun:Function0) + }) + } + } + } else case51() + } + case41() + } + } + } + def assertErased(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt(), tree, ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure(). + apply + (tree.symbol(ctx)).unary_!() + then Erasure.this.assertErased(tree.typeOpt().widen(ctx), tree, ctx) + else + () + if ctx.mode().isExpr() then { + val selector14: dotty.tools.dotc.core.Types.Type = + tree.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + { + def case61(): Unit = { + def case71(): Unit = { + def matchFail41(): Unit = throw new MatchError(selector14) + { + { + () + } + } + } + if selector14.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val ref: dotty.tools.dotc.core.Types.TermRef = + selector14.asInstanceOf[dotty.tools.dotc.core.Types.TermRef] + { + { + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations.SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations.UniqueRefDenotation + ] + ) + , { + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["non-sym type "," of class ", + " with denot of class " + ," of ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [ref,{ + ref.getClass() + },{ + ref.denot(ctx).getClass() + },tree] + ): + , ctx) + closure($anonfun:Function0) + }) + } + } + } else case71() + } + case61() + } + } else () + } + def assertErased(val tp: dotty.tools.dotc.core.Types.Type, + val tree: dotty.tools.dotc.ast.Trees.Tree + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp, ctx), { + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""] + ): + ) + ).i( + Predef.wrapRefArray( + [tp,{ + tp.toString() + },{ + tp.getClass() + },tree,{ + tree.tpe() + },{ + tree.getClass() + },{ + ctx.phase() + }] + ): + , ctx) + closure($anonfun:Function0) + }) + def assertErased$default$2(): dotty.tools.dotc.ast.Trees.Thicket = + dotty.tools.dotc.ast.tpd.EmptyTree() + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$ extends Object with dotty.tools.dotc.transform.TypeTestsCasts + + { this: => + def (): dotty.tools.dotc.transform.Erasure$ = { + Erasure$.super() + Erasure$.super[TypeTestsCasts]() + () + } + val Boxing: dotty.tools.dotc.transform.Erasure.Boxing$ = + new dotty.tools.dotc.transform.Erasure.Boxing$() + class Boxing$ extends Object { this: => + def (): dotty.tools.dotc.transform.Erasure.Boxing$ = { + Boxing$.super() + () + } + def isUnbox(val sym: dotty.tools.dotc.core.Symbols.Symbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().unbox()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses().contains + ( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def isBox(val sym: dotty.tools.dotc.core.Symbols.Symbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().box()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses().contains + ( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def boxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx + ) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().box(), + ctx + ).symbol() + def unboxMethod(val cls: dotty.tools.dotc.core.Symbols.ClassSymbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx + ) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().unbox(), + ctx + ).symbol() + def safelyRemovableUnboxArg(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = { + val selector15: dotty.tools.dotc.ast.Trees.Tree = tree + { + def case81(): dotty.tools.dotc.ast.Trees.Tree = { + def case91(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail51(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector15) + { + { + dotty.tools.dotc.ast.tpd.EmptyTree() + } + } + } + if selector15.isInstanceOf[dotty.tools.dotc.ast.Trees.Apply] then + { + val x22: dotty.tools.dotc.ast.Trees.Apply = + selector15.asInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + { + val o101: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply( + selector15.asInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + ) + if o101.isDefined() then { + val x32: Tuple2 = o101.get().asInstanceOf[Tuple2] + { + val fn: dotty.tools.dotc.ast.Trees.Tree = + x32._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val p42: scala.collection.immutable.List = + x32._2().asInstanceOf[scala.collection.immutable.List] + if p42.isInstanceOf[scala.collection.immutable.::] then { + val x51: scala.collection.immutable.:: = + p42.asInstanceOf[scala.collection.immutable.::] + { + val o91: Option = + scala.package.::().unapply( + p42.asInstanceOf[scala.collection.immutable.::] + ) + if o91.isDefined() then { + val x61: Tuple2 = o91.get().asInstanceOf[Tuple2] + { + val arg: dotty.tools.dotc.ast.Trees.Tree = + x61._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees.Tree + ] + val p71: scala.collection.immutable.List = + x61._2().asInstanceOf[ + scala.collection.immutable.List + ] + if scala.package.Nil().equals(p71) then { + val x81: scala.collection.immutable.Nil$ = + p71.asInstanceOf[ + scala.collection.immutable.Nil$ + ] + { + if + dotty.tools.dotc.transform.Erasure.Boxing. + isUnbox + (fn.symbol(ctx), ctx).&&( + dotty.tools.dotc.core.Symbols.defn(ctx). + ScalaBoxedClasses + ().contains( + arg.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx).typeSymbol(ctx) + ) + ) + then { + arg + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + case81() + } + } + def constant(val tree: dotty.tools.dotc.ast.Trees.Tree, + val const: dotty.tools.dotc.ast.Trees.Tree + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree, ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.Trees.Tree = tree + scala.package.Nil().::($2$) + }, const, ctx) + def box(val tree: dotty.tools.dotc.ast.Trees.Tree, val target: Function0 + , + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + ctx.traceIndented({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["boxing ",": "," into ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree.showSummary(ctx) + },{ + tree.tpe() + },target.apply()] + ): + , ctx) + closure($anonfun:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + def $anonfun(): dotty.tools.dotc.ast.Trees.Tree = { + { + val selector16: dotty.tools.dotc.core.Types.Type = + tree.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type]. + widen + (ctx) + { + def case101(): dotty.tools.dotc.ast.Trees.Tree = { + def case111(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail61(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector16) + { + val tp: dotty.tools.dotc.core.Types.Type = selector16 + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + tp.classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass( + ) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant( + tree + , + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx). + BoxedUnit_UNIT + () + , ctx) + , ctx) + else + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx). + NothingClass + () + ) + then tree else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx). + ArrayClass + () + ) + ) + val arg: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree, ctx) + if arg.isEmpty() then + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + boxMethod + (cls.asClass(), ctx) + , ctx) + ).appliedTo(tree, ctx) + else { + ctx.log({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray( + ["boxing an unbox: "," -> ",""] + ): + ).s( + Predef.wrapRefArray( + [{ + tree.symbol(ctx) + },{ + arg.tpe().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + }] + ): + ) + closure($anonfun:Function0) + }) + arg + } + } + } + } + } + if + selector16.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x23: dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o52: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + ) + if o52.isDefined() then { + val x33: Tuple2 = o52.get().asInstanceOf[Tuple2] + { + val clazz: dotty.tools.dotc.core.Symbols.ClassSymbol + = + x33._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols.ClassSymbol + ] + { + val p43: dotty.tools.dotc.core.Types.Type = + x33._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx).typeRef(ctx) + , { + val $3$: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.transform.Erasure.Boxing. + cast + (tree, + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + ( + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz, ctx) + , ctx) + , ctx) + scala.package.Nil().::($3$) + }, ctx) + } + } + } + } else case111() + } + } else case111() + } + case101() + } + } + } + closure($anonfun:Function0) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + def box$default$2(): String = "" + def unbox(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + ctx.traceIndented({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["unboxing ",": "," as a ",""]): + + ) + ).i( + Predef.wrapRefArray( + [{ + tree.showSummary(ctx) + },{ + tree.tpe() + },pt] + ): + , ctx) + closure($anonfun:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + def $anonfun(): dotty.tools.dotc.ast.Trees.Tree = { + { + val selector17: dotty.tools.dotc.core.Types.Type = pt + { + def case121(): dotty.tools.dotc.ast.Trees.Tree = { + def case131(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail71(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector17) + { + { + val cls: dotty.tools.dotc.core.Symbols.Symbol = + pt.widen(ctx).classSymbol(ctx) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass( + ) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant( + tree + , + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply( + scala.runtime.BoxedUnit$#UNIT + ) + , ctx) + , ctx) + else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx). + ArrayClass + () + ) + ) + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + unboxMethod + (cls.asClass(), ctx) + , ctx) + ).appliedTo(tree, ctx) + } + } + } + } + if + selector17.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + then { + val x24: dotty.tools.dotc.core.TypeErasure.ErasedValueType + = + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + { + val o41: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType. + unapply + ( + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure.ErasedValueType + ] + ) + if o41.isDefined() then { + val x34: Tuple2 = o41.get().asInstanceOf[Tuple2] + { + val clazz: dotty.tools.dotc.core.Symbols.ClassSymbol + = + x34._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols.ClassSymbol + ] + val underlying: dotty.tools.dotc.core.Types.Type = + x34._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + { + val tree1: dotty.tools.dotc.ast.Trees.Tree = + if + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].isRef( + dotty.tools.dotc.core.Symbols.defn(ctx). + NullClass + () + , ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (underlying).isPrimitiveValueType(ctx) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, underlying, ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.transform.Erasure.Boxing + . + adaptToType(tree, + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz, ctx).typeRef(ctx) + , ctx) + ).select( + dotty.tools.dotc.transform.ValueClasses. + valueClassUnbox + ( + dotty.tools.dotc.core.Symbols. + toClassDenot + (clazz, ctx) + , ctx) + , ctx) + ).appliedToNone(ctx) + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree1 + , pt, ctx) + } + } + } + } else case131() + } + } else case131() + } + case121() + } + } + } + closure($anonfun:Function0) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + def cast(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + def tailLabel11(val $this: dotty.tools.dotc.transform.Erasure.Boxing$ + , + val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + if + pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass(), ctx) + then dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt, ctx) + else + { + val selector18: Tuple2 = Tuple2.apply(tree.tpe(), pt) + { + def case141(): dotty.tools.dotc.ast.Trees.Tree = { + def case151(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail81(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector18) + { + { + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + pt).isPrimitiveValueType(ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + , ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps(tree).asInstance(pt, + ctx + ) + } + } + } + { + val o111: Option = Tuple2.unapply(selector18) + if o111.isDefined() then { + val x25: Tuple2 = o111.get().asInstanceOf[Tuple2] + { + val p31: dotty.tools.dotc.core.Types.Type = + x25._1().asInstanceOf[dotty.tools.dotc.core.Types.Type + ] + val p44: dotty.tools.dotc.core.Types.Type = + x25._2().asInstanceOf[dotty.tools.dotc.core.Types.Type + ] + if + p31.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x52: dotty.tools.dotc.core.Types.JavaArrayType = + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o102: Option = + dotty.tools.dotc.core.Types.JavaArrayType.unapply( + p31.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + ) + if o102.isDefined() then { + val x62: dotty.tools.dotc.core.Types.Type = + o102.get().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + val treeElem: dotty.tools.dotc.core.Types.Type + = + x62 + if + p44.isInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + then { + val x71: + dotty.tools.dotc.core.Types.JavaArrayType + = + p44.asInstanceOf[ + dotty.tools.dotc.core.Types.JavaArrayType + ] + { + val o92: Option = + dotty.tools.dotc.core.Types.JavaArrayType. + unapply + ( + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + JavaArrayType + ] + ) + if o92.isDefined() then { + val x82: dotty.tools.dotc.core.Types.Type + = + o92.get().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + val ptElem: + dotty.tools.dotc.core.Types.Type + = x82 + { + if + dotty.tools.dotc.transform.TypeUtils + . + decorateTypeUtils( + treeElem.widen(ctx) + ).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform. + TypeUtils + .decorateTypeUtils(ptElem). + isPrimitiveValueType + (ctx).unary_!() + ) + then { + tailLabel11($this, + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols. + defn + (ctx).runtimeMethod( + dotty.tools.dotc.core. + StdNames + .nme().toObjectArray() + ) + , ctx) + ).appliedTo(tree, ctx) + , pt, ctx) + } else case151() + } + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } + case141() + } + } + } + tailLabel11(Boxing$.this, tree, pt, ctx) + } + def adaptToType(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + def tailLabel12(val $this: dotty.tools.dotc.transform.Erasure.Boxing$ + , + val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = + if pt.isInstanceOf[dotty.tools.dotc.typer.ProtoTypes.FunProto] then + tree + else { + val selector19: dotty.tools.dotc.core.Types.Type = + tree.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type].widen( + ctx + ) + { + def case161(): dotty.tools.dotc.ast.Trees.Tree = { + def case171(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail91(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector19) + { + val tpw: dotty.tools.dotc.core.Types.Type = selector19 + { + if + pt.isInstanceOf[dotty.tools.dotc.core.Types.ProtoType] + . + ||( + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].<:<(pt, ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(tree + , + { + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + () + closure($anonfun:Function0) + } + , ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box( + tree + , { + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing. + box$default$2 + () + closure($anonfun:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, pt, ctx) + , pt, ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast + ( + tree, pt, ctx) + } + } + } + if + selector19.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x26: dotty.tools.dotc.core.Types.MethodType = + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o71: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o71.isDefined() then { + val x35: Tuple2 = o71.get().asInstanceOf[Tuple2] + { + val p45: scala.collection.immutable.List = + x35._1().asInstanceOf[ + scala.collection.immutable.List + ] + if scala.package.Nil().equals(p45) then { + val x63: scala.collection.immutable.Nil$ = + p45.asInstanceOf[scala.collection.immutable.Nil$] + { + val p51: scala.collection.immutable.List = + x35._2().asInstanceOf[ + scala.collection.immutable.List + ] + if tree.isTerm() then { + tailLabel12($this, + dotty.tools.dotc.ast.tpd.TreeOps(tree). + appliedToNone + (ctx) + , pt, ctx) + } else case171() + } + } else case171() + } + } else case171() + } + } else case171() + } + case161() + } + } + tailLabel12(Boxing$.this, tree, pt, ctx) + } + } + class Typer extends dotty.tools.dotc.typer.ReTyper with + dotty.tools.dotc.typer + .NoChecking { + def (): dotty.tools.dotc.transform.Erasure.Typer = { + Typer.super() + Typer.super[NoChecking]() + () + } + def checkNonCyclic(val sym: dotty.tools.dotc.core.Symbols.Symbol, + val info: dotty.tools.dotc.core.Types.TypeBounds + , val reportErrors: Boolean, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = + Typer.super[NoChecking].checkNonCyclic(sym, info, reportErrors, ctx) + def checkValue(val tree: dotty.tools.dotc.ast.Trees.Tree, + val proto: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = Typer.super[NoChecking].checkValue(tree, proto, ctx) + def checkBounds(val args: scala.collection.immutable.List, + val poly: dotty.tools.dotc.core.Types.PolyType + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkBounds(args, poly, ctx) + def checkStable(val tp: dotty.tools.dotc.core.Types.Type, + val pos: dotty.tools.dotc.util.Positions.Position + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkStable(tp, pos, ctx) + def checkLegalPrefix(val tp: dotty.tools.dotc.core.Types.Type, + val selector: dotty.tools.dotc.core.Names.Name + , val pos: dotty.tools.dotc.util.Positions.Position, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = + Typer.super[NoChecking].checkLegalPrefix(tp, selector, pos, ctx) + def checkClassTypeWithStablePrefix( + val tp: dotty.tools.dotc.core.Types.Type + , val pos: dotty.tools.dotc.util.Positions.Position, + val traitReq: Boolean + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.core.Types.Type + = + Typer.super[NoChecking].checkClassTypeWithStablePrefix(tp, pos, + traitReq + , ctx) + def checkImplicitParamsNotSingletons( + val vparamss: scala.collection.immutable.List + , val ctx: dotty.tools.dotc.core.Contexts.Context): Unit = + Typer.super[NoChecking].checkImplicitParamsNotSingletons(vparamss, ctx + ) + def checkFeasible(val tp: dotty.tools.dotc.core.Types.Type, + val pos: dotty.tools.dotc.util.Positions.Position + , val where: ()String, val ctx: dotty.tools.dotc.core.Contexts.Context) + : + dotty.tools.dotc.core.Types.Type = + Typer.super[NoChecking].checkFeasible(tp, pos, + where().asInstanceOf[Function0] + , ctx) + def checkNoDoubleDefs(val cls: dotty.tools.dotc.core.Symbols.Symbol, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): Unit = Typer.super[NoChecking].checkNoDoubleDefs(cls, ctx) + def checkFeasible$default$3(): String = + Typer.super[NoChecking].checkFeasible$default$3() + def erasedType(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.core.Types.Type = { + val selector110: dotty.tools.dotc.core.Types.Type = tree.typeOpt() + { + def case181(): dotty.tools.dotc.core.Types.Type = { + def case191(): dotty.tools.dotc.core.Types.Type = { + def matchFail101(): dotty.tools.dotc.core.Types.Type = + throw new MatchError(selector110) + { + val tp: dotty.tools.dotc.core.Types.Type = selector110 + { + dotty.tools.dotc.core.TypeErasure.erasure(tp, ctx) + } + } + } + if selector110.isInstanceOf[dotty.tools.dotc.core.Types.TermRef] + then + { + val tp: dotty.tools.dotc.core.Types.TermRef = + selector110.asInstanceOf[dotty.tools.dotc.core.Types.TermRef] + { + if tree.isTerm() then { + dotty.tools.dotc.core.TypeErasure.erasedRef(tp, ctx) + } else case191() + } + } else case191() + } + case181() + } + } + def promote(val tree: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = { + assert(tree.hasType()) + val erased: dotty.tools.dotc.core.Types.Type = + Typer.this.erasedType(tree, ctx) + ctx.log({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray(["promoting ",": ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree.show(ctx) + },{ + erased.showWithUnderlying( + erased.showWithUnderlying$default$1() + , ctx) + }] + ): + ) + closure($anonfun:Function0) + }) + tree.withType(erased, ctx) + } + def typedLiteral(val tree: dotty.tools.dotc.ast.Trees.Literal, + val ctc: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Literal = + if + tree.typeOpt().isRef( + dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass() + , ctc) + then + tree.withType(tree.typeOpt(), ctc).asInstanceOf[ + dotty.tools.dotc.ast.Trees.Literal + ] + else super.typedLiteral(tree, ctc) + def typedSelect(val tree: dotty.tools.dotc.ast.Trees.Select, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val sym: dotty.tools.dotc.core.Symbols.Symbol = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).exists(), { + def $anonfun(): String = tree.show(ctx) + closure($anonfun:Function0) + }) + def select(val qual: dotty.tools.dotc.ast.Trees.Tree, + val sym: dotty.tools.dotc.core.Symbols.Symbol + ): dotty.tools.dotc.ast.Trees.Tree = { + val name: dotty.tools.dotc.core.Names.Name = { + val selector111: dotty.tools.dotc.core.Types.Type = tree.typeOpt() + { + def case201(): dotty.tools.dotc.core.Names.Name = { + def case211(): dotty.tools.dotc.core.Names.Name = { + def matchFail111(): dotty.tools.dotc.core.Names.Name = + throw new MatchError(selector111) + { + { + sym.name(ctx) + } + } + } + if + selector111.isInstanceOf[ + dotty.tools.dotc.core.Types.NamedType + ] + then { + val tp: dotty.tools.dotc.core.Types.NamedType = + selector111.asInstanceOf[ + dotty.tools.dotc.core.Types.NamedType + ] + { + if + dotty.tools.dotc.core.NameOps.NameDecorator(tp.name()). + isInheritedName + () + then { + dotty.tools.dotc.core.NameOps.NameDecorator( + sym.name(ctx) + ).inheritedName() + } else case211() + } + } else case211() + } + case201() + } + } + dotty.tools.dotc.ast.untpd.cpy().Select(tree, qual, sym.name(ctx), + ctx + ).withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym( + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + , sym, ctx) + , ctx) + } + def selectArrayMember(val qual: dotty.tools.dotc.ast.Trees.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = { + def tailLabel14(val $this: dotty.tools.dotc.transform.Erasure.Typer + , + val qual: dotty.tools.dotc.ast.Trees.Tree, + val erasedPre: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + , ctx) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator(tree.name()). + genericArrayOp + () + , pt, Predef.wrapRefArray([qual]): , ctx) + else + if + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type].<:<( + erasedPre + , ctx).unary_!() + then + tailLabel14($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, + erasedPre + , ctx) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy().Select(tree, qual, + dotty.tools.dotc.core.NameOps.NameDecorator(tree.name()). + primitiveArrayOp + () + , ctx) + , qual, ctx) + tailLabel14(Typer.this, qual, erasedPre) + } + def adaptIfSuper(val qual: dotty.tools.dotc.ast.Trees.Tree): + dotty.tools.dotc.ast.Trees.Tree + = { + val selector113: dotty.tools.dotc.ast.Trees.Tree = qual + { + def case231(): dotty.tools.dotc.ast.Trees.Tree = { + def case241(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail131(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector113) + { + { + qual + } + } + } + if selector113.isInstanceOf[dotty.tools.dotc.ast.Trees.Super] + then + { + val x28: dotty.tools.dotc.ast.Trees.Super = + selector113.asInstanceOf[dotty.tools.dotc.ast.Trees.Super] + { + val o61: Option = + dotty.tools.dotc.ast.Trees.Super.unapply( + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Super + ] + ) + if o61.isDefined() then { + val x37: Tuple2 = o61.get().asInstanceOf[Tuple2] + { + val thisQual: dotty.tools.dotc.ast.Trees.Tree = + x37._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val p46: dotty.tools.dotc.core.Names.TypeName = + x37._2().asInstanceOf[ + dotty.tools.dotc.core.Names.TypeName + ] + if + dotty.tools.dotc.core.StdNames.tpnme().EMPTY().equals( + p46 + ) + then { + val x53: dotty.tools.dotc.core.Names.TypeName = + p46: dotty.tools.dotc.core.Names.TypeName + { + { + val $4$: Tuple2 = { + val selector112: + dotty.tools.dotc.core.Types.Type + = + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ]: dotty.tools.dotc.core.Types.Type + { + def case221(): Tuple2 = { + def matchFail121(): Tuple2 = + throw new MatchError(selector112) + if + selector112.isInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + then { + val x27: + dotty.tools.dotc.core.Types.SuperType + = + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types.SuperType + ] + { + val o42: Option = + dotty.tools.dotc.core.Types.SuperType. + unapply + ( + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + SuperType + ] + ) + if o42.isDefined() then { + val x36: Tuple2 = + o42.get().asInstanceOf[Tuple2] + { + val thisType: + dotty.tools.dotc.core.Types.Type + = + x36._1().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + val supType: + dotty.tools.dotc.core.Types.Type + = + x36._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + { + Tuple2.apply(thisType, supType) + } + } + } else matchFail121() + } + } else matchFail121() + } + case221() + } + } + val thisType: dotty.tools.dotc.core.Types.Type = + $4$._1().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + val supType: dotty.tools.dotc.core.Types.Type = + $4$._2().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ] + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx + ) + .owner() + , ctx).is(dotty.tools.dotc.core.Flags.Trait(), + ctx + ) + then + dotty.tools.dotc.ast.tpd.cpy().Super(qual, + thisQual + , + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx + ) + .owner().asClass().name(ctx).asInstanceOf[ + dotty.tools.dotc.core.Names.TypeName + ] + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym + , + ctx).owner() + , ctx).typeRef(ctx) + , ctx) + , ctx) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , thisType.firstParent(ctx), ctx) + , ctx) + } + } + } else case241() + } + } else case241() + } + } else case241() + } + case231() + } + } + def recur(val qual: dotty.tools.dotc.ast.Trees.Tree): + dotty.tools.dotc.ast.Trees.Tree + = { + def tailLabel16(val $this: dotty.tools.dotc.transform.Erasure.Typer + , + val qual: dotty.tools.dotc.ast.Trees.Tree): + dotty.tools.dotc.ast.Trees.Tree + = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type]. + widen + (ctx) + ).isPrimitiveValueType(ctx) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).isPrimitiveValueClass(ctx) + if + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyValClass() + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).isConstructor( + ) + , { + def $anonfun(): String = + StringContext.apply(Predef.wrapRefArray(["",""]): + ) + .s( + Predef.wrapRefArray( + [{ + sym.showLocated(ctx) + }] + ): + ) + closure($anonfun:Function0) + }) + select(qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + , ctx).info(ctx).decl(sym.name(ctx), ctx).symbol() + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!()).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + ).isErasedValueType(ctx) + ) + then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, { + def $anonfun(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2( + ) + closure($anonfun:Function0) + }, ctx) + ) + else + if qualIsPrimitive.unary_!().&&(symIsPrimitive) then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner( + ) + , ctx).typeRef(ctx) + , ctx) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner().eq + ( + dotty.tools.dotc.core.Symbols.defn(ctx).ArrayClass()) + then + selectArrayMember(qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree.qualifier().typeOpt().widen(ctx).finalResultType( + ) + , ctx) + ) + else { + val qual1: dotty.tools.dotc.ast.Trees.Tree = + adaptIfSuper(qual) + if + qual1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner( + ) + , ctx).||( + qual1.isInstanceOf[dotty.tools.dotc.ast.Trees.Super] + ) + then select(qual1, sym) else + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx). + owner + () + , ctx).typeRef(ctx) + , ctx) + ) + } + } + tailLabel16(Typer.this, qual) + } + recur( + Typer.this.typed(tree.qualifier(), + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + , ctx) + ) + } + def typedSelectFromTypeTree( + val tree: dotty.tools.dotc.ast.Trees.SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.Type, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name()).withPos(tree.pos()). + asInstanceOf + [dotty.tools.dotc.ast.Trees.Tree].withType( + Typer.this.erasedType(tree, ctx) + , ctx) + def typedThis(val tree: dotty.tools.dotc.ast.Trees.This, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx), ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree, ctx) else { + ctx.log({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["computing outer path from ","%, % to ",", encl class = " + , + ""] + ): + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + ownersIterator + (ctx).toList() + },{ + tree.symbol(ctx) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + }] + ): + , ctx) + closure($anonfun:Function0) + }) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs(val name: dotty.tools.dotc.core.Names.Name + , + val pt: dotty.tools.dotc.core.Types.Type, val args: scala.collection.Seq + , + val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val meth: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: scala.collection.immutable.List = + dotty.tools.dotc.core.Symbols.toDenot(meth, ctx).info(ctx). + firstParamTypes + ().drop(args.length()) + val followingArgs: scala.collection.immutable.List = + dotty.tools.dotc.core.Decorators.ListDecorator( + Typer.this.protoArgs(pt) + ).zipWithConserve(followingParams, { + def $anonfun(tree: dotty.tools.dotc.ast.Trees.Tree, + pt: dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = + Typer.this.typedExpr(tree, pt, ctx) + closure($anonfun) + }): scala.collection.immutable.List + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + , ctx) + ).appliedToArgs( + args.toList().++(followingArgs, + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + , ctx) + } + def protoArgs(val pt: dotty.tools.dotc.core.Types.Type): + scala.collection.immutable.List + = { + val selector114: dotty.tools.dotc.core.Types.Type = pt + { + def case251(): scala.collection.immutable.List = { + def case261(): scala.collection.immutable.List = { + def matchFail141(): scala.collection.immutable.List = + throw new MatchError(selector114) + { + { + scala.package.Nil() + } + } + } + if + selector114.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto + ] + then { + val pt: dotty.tools.dotc.typer.ProtoTypes.FunProto = + selector114.asInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes.FunProto + ] + { + { + pt.args().++(Typer.this.protoArgs(pt.resultType()), + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + } + } + } else case261() + } + case251() + } + } + def typedTypeApply(val tree: dotty.tools.dotc.ast.Trees.TypeApply, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val ntree: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree: dotty.tools.dotc.ast.Trees.TypeApply + , ctx) + { + val selector116: dotty.tools.dotc.ast.Trees.Tree = ntree + { + def case291(): dotty.tools.dotc.ast.Trees.Tree = { + def case301(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail161(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector116) + { + { + Typer.this.typedExpr(ntree, pt, ctx) + } + } + } + if + selector116.isInstanceOf[dotty.tools.dotc.ast.Trees.TypeApply] + then { + val x29: dotty.tools.dotc.ast.Trees.TypeApply = + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply + ] + { + val o43: Option = + dotty.tools.dotc.ast.Trees.TypeApply.unapply( + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees.TypeApply + ] + ) + if o43.isDefined() then { + val x38: Tuple2 = o43.get().asInstanceOf[Tuple2] + { + val fun: dotty.tools.dotc.ast.Trees.Tree = + x38._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val args: scala.collection.immutable.List = + x38._2().asInstanceOf[scala.collection.immutable.List] + { + { + val fun1: dotty.tools.dotc.ast.Trees.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + , ctx) + { + val selector115: dotty.tools.dotc.core.Types.Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx) + { + def case271(): dotty.tools.dotc.ast.Trees.Tree + = + { + def case281(): dotty.tools.dotc.ast.Trees.Tree + = + { + def matchFail151(): + dotty.tools.dotc.ast.Trees.Tree + = throw new MatchError(selector115) + { + { + fun1 + } + } + } + if + selector115.isInstanceOf[ + dotty.tools.dotc.core.Types.PolyType + ] + then { + val funTpe: + dotty.tools.dotc.core.Types.PolyType + = + selector115.asInstanceOf[ + dotty.tools.dotc.core.Types.PolyType + ] + { + { + val args1: + scala.collection.immutable.List + = + dotty.tools.dotc.core.Decorators. + ListDecorator + (args).mapconserve({ + def $anonfun( + _$1: + dotty.tools.dotc.ast.Trees.Tree + ): dotty.tools.dotc.ast.Trees.Tree + = + Typer.this.typedType(_$1, + Typer.this.typedType$default$2() + , ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy(). + TypeApply + (tree, fun1, args1, ctx).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd. + ListOfTreeDecorator + (args1).tpes() + , ctx) + , ctx) + } + } + } else case281() + } + case271() + } + } + } + } + } + } else case301() + } + } else case301() + } + case291() + } + } + } + def typedApply(val tree: dotty.tools.dotc.ast.Trees.Apply, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = { + val $5$: Tuple2 = { + val selector117: dotty.tools.dotc.ast.Trees.Apply = + tree: dotty.tools.dotc.ast.Trees.Apply + { + def case311(): Tuple2 = { + def matchFail171(): Tuple2 = throw new MatchError(selector117) + { + val o31: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply(selector117) + if o31.isDefined() then { + val x210: Tuple2 = o31.get().asInstanceOf[Tuple2] + { + val fun: dotty.tools.dotc.ast.Trees.Tree = + x210._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val args: scala.collection.immutable.List = + x210._2().asInstanceOf[scala.collection.immutable.List] + { + Tuple2.apply(fun, args) + } + } + } else matchFail171() + } + } + case311() + } + } + val fun: dotty.tools.dotc.ast.Trees.Tree = + $5$._1().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + val args: scala.collection.immutable.List = + $5$._2().asInstanceOf[scala.collection.immutable.List] + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply() + ) + then + Typer.this.typedUnadapted( + args.head().asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + , pt, ctx) + else { + val selector119: dotty.tools.dotc.ast.Trees.Tree = + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this + , + ctx) + , ctx) + { + def case341(): dotty.tools.dotc.ast.Trees.Apply = { + def case351(): dotty.tools.dotc.ast.Trees.Apply = { + def matchFail191(): dotty.tools.dotc.ast.Trees.Apply = + throw new MatchError(selector119) + { + val fun1: dotty.tools.dotc.ast.Trees.Tree = selector119 + { + { + val selector118: dotty.tools.dotc.core.Types.Type = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx) + { + def case321(): dotty.tools.dotc.ast.Trees.Apply = { + def case331(): dotty.tools.dotc.ast.Trees.Apply = { + def matchFail181(): + dotty.tools.dotc.ast.Trees.Apply + = throw new MatchError(selector118) + { + { + throw + new MatchError( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + Predef.wrapRefArray( + ["tree ", + " has unexpected type of function " + ,", was ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [tree,{ + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.Type + ].widen(ctx) + },{ + fun.typeOpt().widen(ctx) + }] + ): + , ctx) + ) + } + } + } + if + selector118.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val mt: dotty.tools.dotc.core.Types.MethodType = + selector118.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + { + val outers: scala.collection.immutable.List = + dotty.tools.dotc.transform.ExplicitOuter. + outer + (ctx).args( + fun: dotty.tools.dotc.ast.Trees.Tree + ) + val args1: scala.collection.immutable.List = + { + val $6$: scala.collection.immutable.List + = + outers + dotty.tools.dotc.core.Decorators. + ListDecorator + ( + args.++(Typer.this.protoArgs(pt), + scala.collection.immutable.List. + canBuildFrom + () + ).asInstanceOf[ + scala.collection.immutable.List + ].:::($6$) + ) + }.zipWithConserve(mt.paramTypes(), { + def $anonfun( + tree: dotty.tools.dotc.ast.Trees.Tree + , pt: dotty.tools.dotc.core.Types.Type): + dotty.tools.dotc.ast.Trees.Tree + = Typer.this.typedExpr(tree, pt, ctx) + closure($anonfun) + }) + dotty.tools.dotc.ast.untpd.cpy().Apply(tree, + fun1 + , args1, ctx).withType(mt.resultType(), ctx). + asInstanceOf + [dotty.tools.dotc.ast.Trees.Apply] + } + } + } else case331() + } + case321() + } + } + } + } + } + if selector119.isInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + then + { + val fun1: dotty.tools.dotc.ast.Trees.Apply = + selector119.asInstanceOf[dotty.tools.dotc.ast.Trees.Apply] + { + { + fun1 + } + } + } else case351() + } + case341() + } + } + } + def typedSeqLiteral(val tree: dotty.tools.dotc.ast.Trees.SeqLiteral, + val pt: dotty.tools.dotc.core.Types.Type + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.SeqLiteral + = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt(), ctx) + , ctx) + def typedValDef(val vdef: dotty.tools.dotc.ast.Trees.ValDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.ValDef + = + super.typedValDef({ + val name$3: dotty.tools.dotc.core.Names.TermName = + dotty.tools.dotc.ast.untpd.cpy().ValDef$default$2(vdef) + val tpt$1: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2(), ctx).withPos( + vdef.tpt().pos() + ).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + ) + val rhs$1: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.ast.untpd.cpy().ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy().ValDef(vdef, name$3, tpt$1, rhs$1) + }, sym, ctx) + def typedDefDef(val ddef: dotty.tools.dotc.ast.Trees.DefDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef + = { + val restpe: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx).resultType + ( + ) + val ddef1: dotty.tools.dotc.ast.Trees.DefDef = { + val name$4: dotty.tools.dotc.core.Names.TermName = + dotty.tools.dotc.ast.untpd.cpy().DefDef$default$2(ddef) + val vparamss$1: scala.collection.immutable.List = { + val $7$: scala.collection.immutable.List = + ddef.vparamss().flatten($conforms()).asInstanceOf[ + scala.collection.immutable.List + ] + scala.package.Nil().::($7$) + } + val tpt$2: dotty.tools.dotc.ast.untpd.TypedSplice = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2() + , ctx).withPos(ddef.tpt().pos()).asInstanceOf[ + dotty.tools.dotc.ast.Trees.Tree + ] + ) + val rhs$2: dotty.tools.dotc.ast.Trees.Tree = { + val selector120: dotty.tools.dotc.ast.Trees.Tree = ddef.rhs() + { + def case361(): dotty.tools.dotc.ast.Trees.Tree = { + def case371(): dotty.tools.dotc.ast.Trees.Tree = { + def matchFail201(): dotty.tools.dotc.ast.Trees.Tree = + throw new MatchError(selector120) + { + { + ddef.rhs() + } + } + } + if selector120.isInstanceOf[dotty.tools.dotc.ast.Trees.Ident] + then + { + val x211: dotty.tools.dotc.ast.Trees.Ident = + selector120.asInstanceOf[dotty.tools.dotc.ast.Trees.Ident] + { + val o62: Option = + dotty.tools.dotc.ast.Trees.Ident.unapply( + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident + ] + ) + if o62.isDefined() then { + val x39: dotty.tools.dotc.core.Names.Name = + o62.get().asInstanceOf[ + dotty.tools.dotc.core.Names.Name + ] + { + val p47: dotty.tools.dotc.core.Names.Name = x39 + if + dotty.tools.dotc.core.StdNames.nme().WILDCARD(). + equals + (p47) + then { + val x54: dotty.tools.dotc.core.Names.TermName = + p47.asInstanceOf[ + dotty.tools.dotc.core.Names.TermName + ] + { + val id: dotty.tools.dotc.ast.Trees.Ident = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees.Ident + ] + { + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe, ctx) + ) + } + } + } else case371() + } + } else case371() + } + } else case371() + } + case361() + } + } + dotty.tools.dotc.ast.untpd.cpy().DefDef(ddef, name$4, + scala.package.Nil() + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym, ctx) + } + def typedTypeDef(val tdef: dotty.tools.dotc.ast.Trees.TypeDef, + val sym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.Tree + = dotty.tools.dotc.ast.tpd.EmptyTree() + def typedStats(val stats: scala.collection.immutable.List, + val exprOwner: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List + = { + val stats1: scala.collection.immutable.List = + dotty.tools.dotc.ast.Trees.flatten( + super.typedStats(stats, exprOwner, ctx) + ) + if ctx.owner().isClass() then { + val $8$: scala.collection.immutable.List = stats1 + Typer.this.addBridges(stats, stats1, ctx).:::($8$) + } else stats1 + } + def addBridges(val oldStats: scala.collection.immutable.List, + val newStats: scala.collection.immutable.List + , val ctx: dotty.tools.dotc.core.Contexts.Context): + scala.collection.immutable.List + = { + val beforeCtx: dotty.tools.dotc.core.Contexts.Context = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase() + ) + def traverse(val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + def tailLabel30(val $this: dotty.tools.dotc.transform.Erasure.Typer + , + val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + { + val selector123: scala.collection.immutable.List = after + { + def case431(): scala.collection.immutable.List = { + def case441(): scala.collection.immutable.List = { + def case451(): scala.collection.immutable.List = { + def matchFail231(): scala.collection.immutable.List = + throw new MatchError(selector123) + if + selector123.isInstanceOf[scala.collection.immutable.:: + ] + then { + val x65: scala.collection.immutable.:: = + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o82: Option = + scala.package.::().unapply( + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o82.isDefined() then { + val x73: Tuple2 = o82.get().asInstanceOf[Tuple2] + { + val newTail: scala.collection.immutable.List = + x73._2().asInstanceOf[ + scala.collection.immutable.List + ] + { + { + tailLabel30($this, newTail, before, + traverse$default$3() + ) + } + } + } + } else matchFail231() + } + } else matchFail231() + } + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x312: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.:: + ] + { + val o94: Option = + scala.package.::().unapply( + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o94.isDefined() then { + val x43: Tuple2 = o94.get().asInstanceOf[Tuple2] + { + val pi52: dotty.tools.dotc.ast.Trees.Tree = + x43._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees.Tree + ] + val newTail: scala.collection.immutable.List = + x43._2().asInstanceOf[ + scala.collection.immutable.List + ] + if + pi52.isInstanceOf[ + dotty.tools.dotc.ast.Trees.DefDef + ] + then { + val member: dotty.tools.dotc.ast.Trees.DefDef = + pi52.asInstanceOf[ + dotty.tools.dotc.ast.Trees.DefDef + ] + { + { + { + val selector122: + scala.collection.immutable.List + = before + { + def case401(): + scala.collection.immutable.List + = { + def case411(): + scala.collection.immutable.List + = { + def case421(): + scala.collection.immutable.List + = { + def matchFail221(): + scala.collection.immutable.List + = + throw + new MatchError(selector122) + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x64: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable. + :: + ] + { + val o81: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable + . + :: + ] + ) + if o81.isDefined() then { + val x72: Tuple2 = + o81.get().asInstanceOf[ + Tuple2 + ] + { + val oldTail: + scala.collection.immutable + . + List + = + x72._2().asInstanceOf[ + scala.collection.immutable + . + List + ] + { + { + tailLabel30($this, + after + , oldTail, + traverse$default$3() + ) + } + } + } + } else matchFail221() + } + } else matchFail221() + } + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x311: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o93: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable + . + :: + ] + ) + if o93.isDefined() then { + val x42: Tuple2 = + o93.get().asInstanceOf[ + Tuple2 + ] + { + val pi51: + dotty.tools.dotc.ast.Trees + . + Tree + = + x42._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees + . + Tree + ] + val oldTail: + scala.collection.immutable + . + List + = + x42._2().asInstanceOf[ + scala.collection.immutable + . + List + ] + if + pi51.isInstanceOf[ + dotty.tools.dotc.ast.Trees + . + DefDef + ] + then { + val oldMember: + dotty.tools.dotc.ast.Trees + . + DefDef + = + pi51.asInstanceOf[ + dotty.tools.dotc.ast.Trees + . + DefDef + ] + { + { + val oldSymbol: + dotty.tools.dotc.core.Symbols + . + Symbol + = + oldMember.symbol( + beforeCtx + ) + val newSymbol: + dotty.tools.dotc.core.Symbols + . + Symbol + = member.symbol(ctx) + assert( + oldSymbol.name( + beforeCtx + ).==( + newSymbol.name(ctx + ) + ) + , { + def $anonfun(): + String + = + StringContext. + apply + ( + Predef. + wrapRefArray + ( + ["", + " bridging with " + ,""] + ): + ).s( + Predef. + wrapRefArray + ( + [{ + oldSymbol. + name + (beforeCtx) + },{ + newSymbol. + name + (ctx) + }] + ): + ) + closure($anonfun: + Function0 + ) + }) + val newOverridden: + scala.collection.immutable + . + Set + = + oldSymbol.denot(ctx) + . + allOverriddenSymbols + ( + ctx).toSet() + val oldOverridden: + scala.collection.immutable + . + Set + = + dotty.tools.dotc. + core + .Symbols.toDenot( + newSymbol + , ctx). + allOverriddenSymbols + (beforeCtx).toSet() + def stillInBaseClass( + val sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean = + dotty.tools.dotc. + core + .Symbols.toDenot( + ctx.owner() + , ctx).derivesFrom( + dotty.tools.dotc. + core + .Symbols.toDenot( + sym + , ctx).owner() + , ctx) + val neededBridges: + scala.collection.immutable + . + Set + = + oldOverridden.--( + newOverridden + ).asInstanceOf[ + scala.collection. + TraversableLike + ].filter({ + def $anonfun( + val sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean = + stillInBaseClass + ( + sym) + closure($anonfun) + }).asInstanceOf[ + scala.collection.immutable + . + Set + ] + val minimalSet: + scala.runtime. + ObjectRef + = + scala.runtime. + ObjectRef$ + #create( + Set().apply( + Predef. + genericWrapArray + ([]): + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + ) + neededBridges.foreach( + { + def $anonfun( + val bridge: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Unit = { + val isRequired: + Boolean + = + minimalSet.elem. + asInstanceOf + [ + scala.collection.immutable + . + Set + ].forall({ + def $anonfun( + nxtBridge: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean = + dotty.tools.dotc + . + core.Symbols + . + toDenot( + bridge + , ctx).info( + ctx + ).=:=( + dotty.tools.dotc + . + core. + Symbols + .toDenot( + nxtBridge + , ctx). + info + (ctx) + , ctx). + unary_! + () + closure( + $anonfun + ) + }) + if isRequired then + + { + val clash: + Option + = + dotty.tools.dotc + . + core.Symbols. + toDenot + ( + dotty.tools.dotc + . + core.Symbols + . + toDenot( + oldSymbol + , ctx).owner + ( + ) + , ctx).decls( + ctx + ).lookupAll( + bridge.name( + ctx + ) + , ctx).find({ + { + def + $anonfun + ( + sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): Boolean + = + { + sym.name + ( + ctx).eq( + bridge + . + name( + ctx + ) + ).&&( + dotty.tools.dotc + . + core. + Symbols + . + toDenot + (sym, + ctx + ).info + ( + ctx). + widen + (ctx). + =:= + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + , + ctx + ). + info + (ctx + ) + . + widen + ( + ctx) + , ctx) + ) + } + closure( + $anonfun + ) + } + }).orElse({ + def $anonfun + ( + ): Option = + emittedBridges + . + find({ + def + $anonfun + ( + val + stat + : + dotty.tools.dotc.ast.Trees + . + DefDef + ): + Boolean + = + stat. + name + ().==( + bridge + . + name + ( + ctx) + ).&&( + stat + . + tpe( + ) + . + asInstanceOf + [ + dotty.tools.dotc.core.Types + . + Type + ] + . + widen + ( + ctx) + . + =:=( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + , + ctx + ) + . + info + ( + ctx + ) + . + widen + ( + ctx + ) + , + ctx + ) + ) + closure( + $anonfun + ) + }).map({ + def + $anonfun + ( + val + _$2 + : + dotty.tools.dotc.ast.Trees + . + DefDef + ): + dotty.tools.dotc.core.Symbols + . + Symbol + = + _$2. + symbol + (ctx) + closure( + $anonfun + ) + }) + closure( + $anonfun + :Function0) + }) + { + val + selector121 + : Option = + clash + { + def case381( + ) + : Unit = { + def + case391 + (): Unit + = + { + def + matchFail211 + (): Unit + = + throw + new + MatchError + ( + selector121 + ) + if + None. + equals + ( + selector121 + ) + then { + val + x41 + : + None$ + = + selector121 + . + asInstanceOf + [ + None$] + { + { + minimalSet + . + elem + = + minimalSet + . + elem + . + asInstanceOf + [ + scala.collection.immutable + . + Set + ] + .+ + ( + bridge + ) + . + asInstanceOf + [ + scala.collection.immutable + . + Set + ] + } + } + } else + matchFail211 + ( + ) + } + if + selector121 + . + isInstanceOf + [ + Some] + then { + val x212 + : + Some = + selector121 + . + asInstanceOf + [ + Some] + { + val + o53 + : + Option + = + Some. + unapply + ( + selector121 + . + asInstanceOf + [ + Some + ] + ) + if + o53. + isDefined + () + then + { + val + x310 + : + dotty.tools.dotc.core.Symbols + . + Symbol + = + o53. + get + (). + asInstanceOf + [ + dotty.tools.dotc.core.Symbols + . + Symbol + ] + { + val + + cl + : + dotty.tools.dotc.core.Symbols + . + Symbol + = + x310 + { + { + ctx + . + error + ( + { + def + + $anonfun + ( + ) + : + String + = + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + ( + [ + "bridge for method " + , + " of type " + , + "\\n" + ] + ) + : + + ) + ) + . + i + ( + Predef + . + wrapRefArray + ( + [ + { + newSymbol + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + newSymbol + , + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + ) + : + + , + ctx + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + ( + [ + "clashes with " + , + " of type " + , + "\\n" + ] + ) + : + + ) + ) + . + i + ( + Predef + . + wrapRefArray + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + , + ctx + ) + . + symbol + ( + ) + . + showLocated + ( + beforeCtx + ) + } + , + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + cl + , + ctx + ) + . + symbol + ( + ) + , + ctx + ) + . + info + ( + beforeCtx + ) + } + ] + ) + : + + , + ctx + ) + ) + . + + + ( + dotty.tools.dotc + . + core + . + Decorators + . + StringInterpolators + ( + StringContext + . + apply + ( + Predef + . + wrapRefArray + ( + [ + "both have same type after erasure: " + , + "" + ] + ) + : + + ) + ) + . + i + ( + Predef + . + wrapRefArray + ( + [ + { + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + dotty.tools.dotc + . + core + . + Symbols + . + toDenot + ( + bridge + , + ctx + ) + . + symbol + ( + ) + , + ctx + ) + . + info + ( + ctx + ) + } + ] + ) + : + + , + ctx + ) + ) + closure( + $anonfun + : + Function0 + ) + } + , + ctx + . + error$default$2 + ( + ) + ) + } + } + } + } + else + case391 + ( + ) + } + } else + case391( + ) + } + case381() + } + } + } + else () + } + closure($anonfun) + }) + val + bridgeImplementations + : + scala.collection.immutable + . + Set + = + minimalSet.elem. + asInstanceOf + [ + scala.collection.immutable + . + Set + ].map({ + { + def $anonfun( + sym: + dotty.tools.dotc.core.Symbols + . + Symbol + ): + dotty.tools.dotc.ast.Trees + . + DefDef + = { + $this. + makeBridgeDef + (member, sym, + ctx + ) + } + closure($anonfun + ) + } + }, + scala.collection.immutable + . + Set.canBuildFrom() + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + emittedBridges.++=( + bridgeImplementations + ) + tailLabel30($this, + newTail + , oldTail, + traverse$default$3() + ) + } + } + } else case421() + } + } else case421() + } + } else case421() + } + if + scala.package.Nil().equals( + selector122 + ) + then { + val x213: + scala.collection.immutable.Nil$ + = + selector122.asInstanceOf[ + scala.collection.immutable.Nil$ + ] + { + { + emittedBridges.toList() + } + } + } else case411() + } + case401() + } + } + } + } + } else case451() + } + } else case451() + } + } else case451() + } + if scala.package.Nil().equals(selector123) then { + val x214: scala.collection.immutable.Nil$ = + selector123.asInstanceOf[scala.collection.immutable.Nil$ + ] + { + { + emittedBridges.toList() + } + } + } else case441() + } + case431() + } + } + } + tailLabel30(Typer.this, after, before, emittedBridges) + } + def traverse$default$3(): scala.collection.mutable.ListBuffer = + collection.mutable.ListBuffer.apply( + Predef.genericWrapArray([]): + ).asInstanceOf[scala.collection.mutable.ListBuffer] + traverse(newStats, oldStats, traverse$default$3()) + } + def makeBridgeDef(val newDef: dotty.tools.dotc.ast.Trees.DefDef, + val parentSym: dotty.tools.dotc.core.Symbols.Symbol + , val ctx: dotty.tools.dotc.core.Contexts.Context): + dotty.tools.dotc.ast.Trees.DefDef + = { + def error(val reason: String): Nothing = { + assert(false, { + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray( + ["failure creating bridge from "," to ",", reason: ",""] + ): + ).s( + Predef.wrapRefArray( + [{ + newDef.symbol(ctx) + },{ + parentSym + },reason] + ): + ) + closure($anonfun:Function0) + }) + ???() + } + val bridge: dotty.tools.dotc.core.Symbols.Symbol = + { + val owner$3: dotty.tools.dotc.core.Symbols.Symbol = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + () + val name$5: dotty.tools.dotc.core.Names.Name = parentSym.name(ctx) + val flags$1: dotty.tools.dotc.core.Flags.FlagSet = + dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).flags(ctx) + . + |(dotty.tools.dotc.core.Flags.Bridge()) + val info$3: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).info(ctx) + val privateWithin$2: dotty.tools.dotc.core.Symbols.Symbol = + ctx.newSymbol$default$5() + ctx.newSymbol(owner$3, name$5, flags$1, info$3, privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().coord() + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase().prev().asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers.DenotTransformer + ] + , ctx) + ctx.debuglog({ + def $anonfun(): String = + StringContext.apply( + Predef.wrapRefArray(["generating bridge from "," to ",""]): + + ).s( + Predef.wrapRefArray( + [{ + newDef.symbol(ctx) + },bridge] + ): + ) + closure($anonfun:Function0) + }) + val sel: dotty.tools.dotc.ast.Trees.Tree = + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().asClass() + , ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + termRef + (ctx) + , ctx) + val resultType: dotty.tools.dotc.core.Types.Type = + dotty.tools.dotc.core.Symbols.toDenot(bridge, ctx).info(ctx).widen( + ctx + ).resultType() + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + def $anonfun(val paramss: scala.collection.immutable.List): + dotty.tools.dotc.ast.Trees.Tree + = { + val rhs: dotty.tools.dotc.ast.Trees.Tree = + paramss.foldLeft(sel, { + def $anonfun(fun: dotty.tools.dotc.ast.Trees.Tree, + vparams: scala.collection.immutable.List + ): dotty.tools.dotc.ast.Trees.Tree = { + val selector124: dotty.tools.dotc.core.Types.Type = + fun.tpe().asInstanceOf[dotty.tools.dotc.core.Types.Type] + . + widen(ctx) + { + def case461(): dotty.tools.dotc.ast.Trees.Apply = { + def case471(): dotty.tools.dotc.ast.Trees.Apply = { + def matchFail241(): dotty.tools.dotc.ast.Trees.Apply + = + throw new MatchError(selector124) + { + val a: dotty.tools.dotc.core.Types.Type = + selector124 + { + error( + StringContext.apply( + Predef.wrapRefArray( + ["can not resolve apply type ",""] + ): + ).s(Predef.wrapRefArray([a]): ) + ) + } + } + } + if + selector124.isInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + then { + val x215: dotty.tools.dotc.core.Types.MethodType = + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + { + val o44: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types.MethodType + ] + ) + if o44.isDefined() then { + val x313: Tuple2 = + o44.get().asInstanceOf[Tuple2] + { + val types: scala.collection.immutable.List = + x313._2().asInstanceOf[ + scala.collection.immutable.List + ] + { + { + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps( + Tuple2.apply(vparams, types) + ).zipped($conforms(), $conforms()).map({ + def $anonfun( + _$3: dotty.tools.dotc.ast.Trees.Tree + , + _$4: + dotty.tools.dotc.core.Types.Type + ): dotty.tools.dotc.ast.Trees.Tree = + Typer.this.adapt(_$3, _$4, + dotty.tools.dotc.ast.untpd. + EmptyTree + () + , ctx) + closure($anonfun) + }, + scala.collection.immutable.List. + canBuildFrom + () + ).asInstanceOf[ + scala.collection.immutable.List + ] + , ctx) + } + } + } + } else case471() + } + } else case471() + } + case461() + } + } + closure($anonfun) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + Typer.this.adapt(rhs, resultType, Typer.this.adapt$default$3(), + ctx + ) + } + closure($anonfun) + } + }, ctx) + } + def adapt(val tree: dotty.tools.dotc.ast.Trees.Tree, + val pt: dotty.tools.dotc.core.Types.Type + , val original: dotty.tools.dotc.ast.Trees.Tree, + val ctx: dotty.tools.dotc.core.Contexts.Context + ): dotty.tools.dotc.ast.Trees.Tree = { + val printer$1: dotty.tools.dotc.config.Printers.Printer = + ctx.traceIndented$default$2() + ctx.traceIndented({ + def $anonfun(): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["adapting ",": "," to ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree.showSummary(ctx) + },{ + tree.tpe() + },pt] + ): + , ctx) + closure($anonfun:Function0) + }, printer$1, true, { + def $anonfun(): dotty.tools.dotc.ast.Trees.Tree = { + assert( + ctx.phase().==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx). + erasurePhase + ().next() + ) + , { + def $anonfun(): dotty.tools.dotc.core.Phases.Phase = ctx.phase() + closure($anonfun:Function0) + }) + if tree.isEmpty() then tree else + if ctx.mode().is(dotty.tools.dotc.typer.Mode.Pattern()) then + tree + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree, pt + , + ctx) + } + closure($anonfun:Function0) + }).asInstanceOf[dotty.tools.dotc.ast.Trees.Tree] + } + } + val Typer: dotty.tools.dotc.transform.Erasure.Typer$ = + new dotty.tools.dotc.transform.Erasure.Typer$() + class Typer$ extends Object { + this: dotty.tools.dotc.transform.Erasure.Typer$ => + + def (): dotty.tools.dotc.transform.Erasure.Typer$ = { + Typer$.super() + () + } + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after TreeTransform:{lambdaLift, flatten, restoreScopes}: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure extends dotty.tools.dotc.util.DotClass with + dotty.tools.dotc.core.Phases + .dotty$tools$dotc$core$Phases$$Phase with + dotty.tools.dotc.core.DenotTransformers + .dotty$tools$dotc$core$DenotTransformers$$DenotTransformer { + thisTransformer: dotty.tools.dotc.transform.Erasure => + + def (): dotty.tools.dotc.transform.Erasure = { + Erasure.super() + Erasure.super[Phase]() + Erasure.super[DenotTransformer]() + Erasure.this.eraser$$local = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + () + () + } + def myPeriod(): + dotty.tools.dotc.core.Periods.dotty$tools$dotc$core$Periods$$Period + = Erasure.super[Phase].initial$myPeriod() + def myBase(): + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$ContextBase + = Erasure.super[Phase].initial$myBase() + def myErasedTypes(): Boolean = + Erasure.super[Phase].initial$myErasedTypes() + def myFlatClasses(): Boolean = + Erasure.super[Phase].initial$myFlatClasses() + def myRefChecked(): Boolean = Erasure.super[Phase].initial$myRefChecked() + def mySymbolicRefs(): Boolean = + Erasure.super[Phase].initial$mySymbolicRefs() + def myPeriod_=( + val x$1: + dotty.tools.dotc.core.Periods.dotty$tools$dotc$core$Periods$$Period + ): Unit = () + def myBase_=( + val x$1: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$ContextBase + ): Unit = () + def myErasedTypes_=(val x$1: Boolean): Unit = () + def myFlatClasses_=(val x$1: Boolean): Unit = () + def myRefChecked_=(val x$1: Boolean): Unit = () + def mySymbolicRefs_=(val x$1: Boolean): Unit = () + def toString(): String = Erasure.super[Phase].toString() + def phaseName(): String = "erasure" + def runsAfter(): scala.collection.immutable.Set = + Set().apply( + Predef.wrapRefArray([classOf(),classOf(),classOf()]): + ).asInstanceOf[scala.collection.immutable.Set] + def transform( + val ref: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + val selector12: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = ref + { + def case21(): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + def case31(): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + def matchFail21(): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = throw new MatchError(selector12) + { + val ref: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = selector12 + { + ref.derivedSingleDenotation(ref.symbol(), + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx), + ctx + ) + , ctx) + } + } + } + if + selector12.isInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ] + then { + val ref: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + = + selector12.asInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ] + { + { + assert(ctx.phase().==(this), { + closure(ctx, ref | Erasure.this.$anonfun$13:Function0) + }) + if + ref.symbol().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + ) + then { + val $1$: Tuple4 = { + val selector11: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + ref.info(ctx): + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + { + def case11(): Tuple4 = { + def matchFail11(): Tuple4 = + throw new MatchError(selector11) + if + selector11.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + then { + val x21: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + = + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + { + val o51: Option = + dotty.tools.dotc.core.Types.ClassInfo.unapply( + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + ) + if o51.isDefined() then { + val x31: Tuple5 = o51.get().asInstanceOf[Tuple5] + { + val pre: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x31._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val ps: scala.collection.immutable.List = + x31._3().asInstanceOf[ + scala.collection.immutable.List + ] + val decls: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + = + x31._4().asInstanceOf[ + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass + = + x31._5().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + { + val p41: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x31._2().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + Tuple4.apply(pre, ps, decls, selfInfo) + } + } + } else matchFail11() + } + } else matchFail11() + } + case11() + } + } + val pre: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $1$._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val ps: scala.collection.immutable.List = + $1$._2().asInstanceOf[scala.collection.immutable.List] + val decls: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + = + $1$._3().asInstanceOf[ + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass = + $1$._4().asInstanceOf[dotty.tools.dotc.util.DotClass] + val extendedScope: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$MutableScope + = decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + , ctx).classInfo(ctx).decls().foreach({ + closure(ctx, extendedScope | + Erasure.this.$anonfun$transform$1 + ) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$1() + val owner$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$2() + val name$1: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = ref.copySymDenotation$default$3() + val initFlags$1: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = ref.copySymDenotation$default$4() + val info$1: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass( + ) + , ps, extendedScope, selfInfo, ctx) + , ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$6() + val annotations$1: scala.collection.immutable.List = + ref.copySymDenotation$default$7() + ref.copySymDenotation(symbol$1, owner$1, name$1, + initFlags$1 + , info$1, privateWithin$1, annotations$1, ctx) + } + } else { + val oldOwner: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.owner() + val newOwner: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + if + oldOwner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + ) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + else oldOwner + val oldInfo: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = ref.info(ctx) + val newInfo: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , oldInfo, ctx) + val oldFlags: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = ref.flags(ctx) + val newFlags: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = + ref.flags(ctx).&~( + dotty.tools.dotc.core.Flags.HasDefaultParams() + ) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass(), ctx). + unary_! + () + , { + closure(ctx, ref, oldOwner, newOwner, oldInfo, newInfo + | + Erasure.this.$anonfun$2:Function0) + }) + { + val symbol$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$1() + val owner$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = newOwner + val name$2: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = ref.copySymDenotation$default$3() + val initFlags$2: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = newFlags + val info$2: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, + initFlags$2 + , info$2, ref.copySymDenotation$default$6(), + ref.copySymDenotation$default$7() + , ctx) + } + } + } + } + } + } else case31() + } + case21() + } + } + val eraser$$local: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + def eraser(): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + = Erasure.this.eraser$$local + def run( + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit() + unit.tpdTree_=( + Erasure.this.eraser().typedExpr(unit.tpdTree(), + Erasure.this.eraser().typedExpr$default$2() + , ctx.fresh().setPhase(this.next())) + ) + } + def checkPostCondition( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + Erasure.this.assertErased(tree, ctx) + { + val selector13: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = tree + { + def case41(): Unit = { + def case51(): Unit = { + def matchFail31(): Unit = throw new MatchError(selector13) + { + { + () + } + } + } + if + selector13.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + ] + then { + val res: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + = + selector13.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + ] + { + { + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + , res, ctx).unary_!() + , { + closure(ctx, res | Erasure.this.$anonfun$1:Function0) + }) + } + } + } else case51() + } + case41() + } + } + } + def assertErased( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt(), tree, ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure(). + apply + (tree.symbol(ctx)).unary_!() + then Erasure.this.assertErased(tree.typeOpt().widen(ctx), tree, ctx) + else + () + if ctx.mode().isExpr() then { + val selector14: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ] + { + def case61(): Unit = { + def case71(): Unit = { + def matchFail41(): Unit = throw new MatchError(selector14) + { + { + () + } + } + } + if + selector14.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + then { + val ref: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + = + selector14.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + { + { + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$UniqueRefDenotation + ] + ) + , { + closure(tree, ctx, ref | Erasure.this.$anonfun$5:Function0 + ) + }) + } + } + } else case71() + } + case61() + } + } else () + } + def assertErased( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp, ctx), { + closure(tp, tree, ctx | Erasure.this.$anonfun$assertErased$1:Function0 + ) + }) + def assertErased$default$2(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Thicket + = dotty.tools.dotc.ast.tpd.EmptyTree() + def $anonfun$13( + val ctx$1: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$1: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ): String = + StringContext.apply( + Predef.wrapRefArray(["transforming "," at ",""]): + ).s( + Predef.wrapRefArray( + [ref$1,{ + ctx$1.phase().asInstanceOf[dotty.tools.dotc.util.DotClass] + }] + ): + ) + def $anonfun$transform$1( + val ctx$2: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val extendedScope$1: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$MutableScope + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + extendedScope$1.enter(sym, ctx$2) + def $anonfun$2( + val ctx$3: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$2: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + , + val oldOwner$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newOwner$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val oldInfo$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val newInfo$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): String = + StringContext.apply( + Predef.wrapRefArray( + ["trans "," @ "," oldOwner = ",", newOwner = ",", oldInfo = ", + ", newInfo = " + ," "," ",""] + ): + ).s( + Predef.genericWrapArray( + [ref$2,{ + ctx$3.phase() + },oldOwner$1,newOwner$1,oldInfo$1,newInfo$1,{ + scala.Boolean.box(oldOwner$1.eq(newOwner$1)) + },{ + scala.Boolean.box(oldInfo$1.eq(newInfo$1)) + }] + ): + ) + def $anonfun$1( + val ctx$4: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val res$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This) + : + String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["Reference to "," from ",""]): + ) + ).i( + Predef.wrapRefArray( + [res$1,{ + ctx$4.owner().showLocated(ctx$4) + }] + ): + , ctx$4) + def $anonfun$5( + val tree$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$5: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$3: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["non-sym type "," of class "," with denot of class "," of ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [ref$3,{ + ref$3.getClass() + },{ + ref$3.denot(ctx$5).getClass() + },tree$1] + ): + , ctx$5) + def $anonfun$assertErased$1( + val tp$1: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val tree$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$6: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""] + ): + ) + ).i( + Predef.wrapRefArray( + [tp$1,{ + tp$1.toString() + },{ + tp$1.getClass() + },tree$2,{ + tree$2.tpe() + },{ + tree$2.getClass() + },{ + ctx$6.phase() + }] + ): + , ctx$6) + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$ extends Object with dotty.tools.dotc.transform.TypeTestsCasts + + { this: => + def (): dotty.tools.dotc.transform.Erasure$ = { + Erasure$.super() + Erasure$.super[TypeTestsCasts]() + () + } + val Boxing: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + () + val Typer: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + () + def $anonfun$10(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def $anonfun$4(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def $anonfun$17(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def traverse$default$3$1(): scala.collection.mutable.ListBuffer = + collection.mutable.ListBuffer.apply( + Predef.genericWrapArray([]): + ).asInstanceOf[scala.collection.mutable.ListBuffer] + } + class Boxing$ extends Object { this: => + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + = { + Boxing$.super() + () + } + def isUnbox( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().unbox()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses().contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def isBox( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().box()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses().contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def boxMethod( + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().box(), ctx) + . + symbol() + def unboxMethod( + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().unbox(), + ctx + ).symbol() + def safelyRemovableUnboxArg( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val selector15: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = tree + { + def case81(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case91(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail51(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector15) + { + { + dotty.tools.dotc.ast.tpd.EmptyTree() + } + } + } + if + selector15.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + then { + val x22: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + { + val o101: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply( + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + ] + ) + if o101.isDefined() then { + val x32: Tuple2 = o101.get().asInstanceOf[Tuple2] + { + val fn: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x32._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p42: scala.collection.immutable.List = + x32._2().asInstanceOf[scala.collection.immutable.List] + if p42.isInstanceOf[scala.collection.immutable.::] then { + val x51: scala.collection.immutable.:: = + p42.asInstanceOf[scala.collection.immutable.::] + { + val o91: Option = + scala.package.::().unapply( + p42.asInstanceOf[scala.collection.immutable.::] + ) + if o91.isDefined() then { + val x61: Tuple2 = o91.get().asInstanceOf[Tuple2] + { + val arg: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x61._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p71: scala.collection.immutable.List = + x61._2().asInstanceOf[ + scala.collection.immutable.List + ] + if scala.package.Nil().equals(p71) then { + val x81: scala.collection.immutable.Nil$ = + p71.asInstanceOf[scala.collection.immutable.Nil$ + ] + { + if + dotty.tools.dotc.transform.Erasure.Boxing. + isUnbox + (fn.symbol(ctx), ctx).&&( + dotty.tools.dotc.core.Symbols.defn(ctx). + ScalaBoxedClasses + ().contains( + arg.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx).typeSymbol(ctx) + ) + ) + then { + arg + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + case81() + } + } + def constant( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val const: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree, ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + tree + scala.package.Nil().::($2$) + }, const, ctx) + def box( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val target: Function0, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + ctx.traceIndented({ + closure(tree, target, ctx | $anonfun$box$2:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + closure(tree, ctx | $anonfun$box$1:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + def box$default$2(): String = "" + def unbox( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + ctx.traceIndented({ + closure(tree, pt, ctx | $anonfun$unbox$1:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + closure(tree, pt, ctx | $anonfun$unbox$2:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + def cast( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel11( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass(), ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt, ctx) else { + val selector18: Tuple2 = Tuple2.apply(tree.tpe(), pt) + { + def case141(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case151(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail81(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector18) + { + { + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + pt + ).isPrimitiveValueType(ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + , ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps(tree).asInstance(pt, + ctx + ) + } + } + } + { + val o111: Option = Tuple2.unapply(selector18) + if o111.isDefined() then { + val x25: Tuple2 = o111.get().asInstanceOf[Tuple2] + { + val p31: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x25._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val p44: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x25._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + if + p31.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + then { + val x52: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + = + p31.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + { + val o102: Option = + dotty.tools.dotc.core.Types.JavaArrayType.unapply( + p31.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + ) + if o102.isDefined() then { + val x62: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + o102.get().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + val treeElem: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = x62 + if + p44.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + then { + val x71: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + = + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + { + val o92: Option = + dotty.tools.dotc.core.Types.JavaArrayType. + unapply + ( + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + ) + if o92.isDefined() then { + val x82: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + o92.get().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + val ptElem: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = x82 + { + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (treeElem.widen(ctx)). + isPrimitiveValueType + (ctx).&&( + dotty.tools.dotc.transform.TypeUtils + . + decorateTypeUtils(ptElem). + isPrimitiveValueType + (ctx).unary_!() + ) + then { + tailLabel11($this, + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols. + defn + (ctx).runtimeMethod( + dotty.tools.dotc.core.StdNames + . + nme().toObjectArray() + ) + , ctx) + ).appliedTo(tree, ctx) + , pt, ctx) + } else case151() + } + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } + case141() + } + } + } + tailLabel11(Boxing$.this, tree, pt, ctx) + } + def adaptToType( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel12( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + pt.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + then tree else { + val selector19: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case161(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case171(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail91(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector19) + { + val tpw: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = selector19 + { + if + pt.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ProtoType + ].||( + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].<:<(pt, ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + tpw).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + { + closure($anonfun$10:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box( + tree + , { + closure($anonfun$4:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, pt, ctx) + , pt, ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree + , pt, ctx) + } + } + } + if + selector19.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val x26: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + val o71: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + ) + if o71.isDefined() then { + val x35: Tuple2 = o71.get().asInstanceOf[Tuple2] + { + val p45: scala.collection.immutable.List = + x35._1().asInstanceOf[scala.collection.immutable.List] + if scala.package.Nil().equals(p45) then { + val x63: scala.collection.immutable.Nil$ = + p45.asInstanceOf[scala.collection.immutable.Nil$] + { + val p51: scala.collection.immutable.List = + x35._2().asInstanceOf[ + scala.collection.immutable.List + ] + if tree.isTerm() then { + tailLabel12($this, + dotty.tools.dotc.ast.tpd.TreeOps(tree). + appliedToNone + (ctx) + , pt, ctx) + } else case171() + } + } else case171() + } + } else case171() + } + } else case171() + } + case161() + } + } + tailLabel12(Boxing$.this, tree, pt, ctx) + } + def $anonfun$box$2( + val tree$3: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val target$1: Function0, + val ctx$7: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["boxing ",": "," into ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$3.showSummary(ctx$7) + },{ + tree$3.tpe() + },target$1.apply()] + ): + , ctx$7) + def $anonfun$11( + val tree$5: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$9: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val arg$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree) + : + String = + StringContext.apply( + Predef.wrapRefArray(["boxing an unbox: "," -> ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree$5.symbol(ctx$9) + },{ + arg$1.tpe().asInstanceOf[dotty.tools.dotc.util.DotClass] + }] + ): + ) + def $anonfun$box$1( + val tree$4: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$8: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + { + val selector16: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree$4.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$8) + { + def case101(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case111(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail61(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector16) + { + val tp: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = selector16 + { + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = tp.classSymbol(ctx$8) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$8).UnitClass() + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree$4 + , + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx$8).BoxedUnit_UNIT + ( + ) + , ctx$8) + , ctx$8) + else + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$8).NothingClass + ( + ) + ) + then tree$4 else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx$8).ArrayClass + ( + ) + ) + ) + val arg: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree$4, ctx$8) + if arg.isEmpty() then + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + boxMethod + (cls.asClass(), ctx$8) + , ctx$8) + ).appliedTo(tree$4, ctx$8) + else { + ctx$8.log({ + closure(tree$4, ctx$8, arg | $anonfun$11:Function0) + }) + arg + } + } + } + } + } + if + selector16.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + then { + val x23: + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + = + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + { + val o52: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType.unapply( + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + ) + if o52.isDefined() then { + val x33: Tuple2 = o52.get().asInstanceOf[Tuple2] + { + val clazz: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x33._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + { + val p43: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x33._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz, + ctx$8 + ).typeRef(ctx$8) + , { + val $3$: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree$4 + , + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + ( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$8) + , ctx$8) + , ctx$8) + scala.package.Nil().::($3$) + }, ctx$8) + } + } + } + } else case111() + } + } else case111() + } + case101() + } + } + } + def $anonfun$unbox$1( + val tree$6: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$1: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$10: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["unboxing ",": "," as a ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$6.showSummary(ctx$10) + },{ + tree$6.tpe() + },pt$1] + ): + , ctx$10) + def $anonfun$unbox$2( + val tree$7: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$2: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$11: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + { + val selector17: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = pt$2 + { + def case121(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case131(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail71(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector17) + { + { + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = pt$2.widen(ctx$11).classSymbol(ctx$11) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$11).UnitClass() + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree$7 + , + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply( + scala.runtime.BoxedUnit$#UNIT + ) + , ctx$11) + , ctx$11) + else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx$11).ArrayClass( + ) + ) + ) + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.unboxMethod( + cls.asClass() + , ctx$11) + , ctx$11) + ).appliedTo(tree$7, ctx$11) + } + } + } + } + if + selector17.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + then { + val x24: + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + = + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + { + val o41: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType.unapply( + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + ) + if o41.isDefined() then { + val x34: Tuple2 = o41.get().asInstanceOf[Tuple2] + { + val clazz: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x34._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + val underlying: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x34._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + { + val tree1: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + if + tree$7.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].isRef( + dotty.tools.dotc.core.Symbols.defn(ctx$11). + NullClass + () + , ctx$11).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (underlying).isPrimitiveValueType(ctx$11) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree$7 + , underlying, ctx$11) + else + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.transform.Erasure.Boxing. + adaptToType + (tree$7, + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$11).typeRef(ctx$11) + , ctx$11) + ).select( + dotty.tools.dotc.transform.ValueClasses. + valueClassUnbox + ( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$11) + , ctx$11) + , ctx$11) + ).appliedToNone(ctx$11) + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree1, + pt$2 + , ctx$11) + } + } + } + } else case131() + } + } else case131() + } + case121() + } + } + } + } + class Typer extends dotty.tools.dotc.typer.ReTyper with + dotty.tools.dotc.typer + .NoChecking { + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + = { + Typer.super() + Typer.super[NoChecking]() + () + } + def checkNonCyclic( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val info: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TypeBounds + , val reportErrors: Boolean, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkNonCyclic(sym, info, reportErrors, ctx) + def checkValue( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val proto: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.super[NoChecking].checkValue(tree, proto, ctx) + def checkBounds(val args: scala.collection.immutable.List, + val poly: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$PolyType + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkBounds(args, poly, ctx) + def checkStable( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkStable(tp, pos, ctx) + def checkLegalPrefix( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val selector: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkLegalPrefix(tp, selector, pos, ctx) + def checkClassTypeWithStablePrefix( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , val traitReq: Boolean, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkClassTypeWithStablePrefix(tp, pos, traitReq + , + ctx) + def checkImplicitParamsNotSingletons( + val vparamss: scala.collection.immutable.List + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = + Typer.super[NoChecking].checkImplicitParamsNotSingletons(vparamss, ctx) + def checkFeasible( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , val where: ()String, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkFeasible(tp, pos, + where().asInstanceOf[Function0] + , ctx) + def checkNoDoubleDefs( + val cls: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkNoDoubleDefs(cls, ctx) + def checkFeasible$default$3(): String = + Typer.super[NoChecking].checkFeasible$default$3() + def erasedType( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = { + val selector110: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = tree.typeOpt() + { + def case181(): + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = { + def case191(): + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = { + def matchFail101(): + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = throw new MatchError(selector110) + { + val tp: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = selector110 + { + dotty.tools.dotc.core.TypeErasure.erasure(tp, ctx) + } + } + } + if + selector110.isInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + ] + then { + val tp: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + = + selector110.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + { + if tree.isTerm() then { + dotty.tools.dotc.core.TypeErasure.erasedRef(tp, ctx) + } else case191() + } + } else case191() + } + case181() + } + } + def promote( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + assert(tree.hasType()) + val erased: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = Typer.this.erasedType(tree, ctx) + ctx.log({ + closure(tree, ctx, erased | Typer.this.$anonfun$promote$1:Function0) + }) + tree.withType(erased, ctx) + } + def typedLiteral( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal + , + val ctc: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal = + if + tree.typeOpt().isRef( + dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass() + , ctc) + then + tree.withType(tree.typeOpt(), ctc).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal + ] + else super.typedLiteral(tree, ctc) + def typedSelect( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).exists(), { + closure(tree, ctx | Typer.this.$anonfun$typedSelect$1:Function0) + }) + Typer.this.recur$1(tree, pt, ctx, sym, + Typer.this.typed(tree.qualifier(), + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + , ctx) + ) + } + def typedSelectFromTypeTree( + val tree: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name()).withPos(tree.pos()). + asInstanceOf + [dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree].withType( + Typer.this.erasedType(tree, ctx) + , ctx) + def typedThis( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx), ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree, ctx) else { + ctx.log({ + closure(tree, ctx | Typer.this.$anonfun$typedThis$1:Function0) + }) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs( + val name: dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val args: scala.collection.Seq + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val meth: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: scala.collection.immutable.List = + dotty.tools.dotc.core.Symbols.toDenot(meth, ctx).info(ctx). + firstParamTypes + ().drop(args.length()) + val followingArgs: scala.collection.immutable.List = + dotty.tools.dotc.core.Decorators.ListDecorator( + Typer.this.protoArgs(pt) + ).zipWithConserve(followingParams, { + closure(ctx | Typer.this.$anonfun$7) + }): scala.collection.immutable.List + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + , ctx) + ).appliedToArgs( + args.toList().++(followingArgs, + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + , ctx) + } + def protoArgs( + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): scala.collection.immutable.List = { + val selector114: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = pt + { + def case251(): scala.collection.immutable.List = { + def case261(): scala.collection.immutable.List = { + def matchFail141(): scala.collection.immutable.List = + throw new MatchError(selector114) + { + { + scala.package.Nil() + } + } + } + if + selector114.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + then { + val pt: + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + = + selector114.asInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + { + { + pt.args().++(Typer.this.protoArgs(pt.resultType()), + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + } + } + } else case261() + } + case251() + } + } + def typedTypeApply( + val tree: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeApply + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val ntree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeApply + , ctx) + { + val selector116: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = ntree + { + def case291(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case301(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail161(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector116) + { + { + Typer.this.typedExpr(ntree, pt, ctx) + } + } + } + if + selector116.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + then { + val x29: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + = + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + { + val o43: Option = + dotty.tools.dotc.ast.Trees.TypeApply.unapply( + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + ) + if o43.isDefined() then { + val x38: Tuple2 = o43.get().asInstanceOf[Tuple2] + { + val fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x38._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + x38._2().asInstanceOf[scala.collection.immutable.List] + { + { + val fun1: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + , ctx) + { + val selector115: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case271(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = { + def case281(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail151(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector115) + { + { + fun1 + } + } + } + if + selector115.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + ] + then { + val funTpe: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + = + selector115.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + ] + { + { + val args1: scala.collection.immutable.List + = + dotty.tools.dotc.core.Decorators. + ListDecorator + (args).mapconserve({ + closure(ctx | Typer.this.$anonfun$12) + }) + dotty.tools.dotc.ast.untpd.cpy().TypeApply + ( + tree, fun1, args1, ctx).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd. + ListOfTreeDecorator + (args1).tpes() + , ctx) + , ctx) + } + } + } else case281() + } + case271() + } + } + } + } + } + } else case301() + } + } else case301() + } + case291() + } + } + } + def typedApply( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val $5$: Tuple2 = { + val selector117: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + { + def case311(): Tuple2 = { + def matchFail171(): Tuple2 = throw new MatchError(selector117) + { + val o31: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply(selector117) + if o31.isDefined() then { + val x210: Tuple2 = o31.get().asInstanceOf[Tuple2] + { + val fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x210._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + x210._2().asInstanceOf[scala.collection.immutable.List] + { + Tuple2.apply(fun, args) + } + } + } else matchFail171() + } + } + case311() + } + } + val fun: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + $5$._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + $5$._2().asInstanceOf[scala.collection.immutable.List] + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply() + ) + then + Typer.this.typedUnadapted( + args.head().asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + , pt, ctx) + else { + val selector119: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this, + ctx + ) + , ctx) + { + def case341(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def case351(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def matchFail191(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = throw new MatchError(selector119) + { + val fun1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = selector119 + { + { + val selector118: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case321(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + = { + def case331(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + = { + def matchFail181(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + = throw new MatchError(selector118) + { + { + throw + new MatchError( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + Predef.wrapRefArray( + ["tree ", + " has unexpected type of function " + ,", was ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [tree,{ + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + },{ + fun.typeOpt().widen(ctx) + }] + ): + , ctx) + ) + } + } + } + if + selector118.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val mt: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector118.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + { + val outers: scala.collection.immutable.List = + dotty.tools.dotc.transform.ExplicitOuter.outer + ( + ctx).args( + fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ) + val args1: scala.collection.immutable.List = + { + val $6$: scala.collection.immutable.List = + outers + dotty.tools.dotc.core.Decorators. + ListDecorator + ( + args.++(Typer.this.protoArgs(pt), + scala.collection.immutable.List. + canBuildFrom + () + ).asInstanceOf[ + scala.collection.immutable.List + ].:::($6$) + ) + }.zipWithConserve(mt.paramTypes(), { + closure(ctx | Typer.this.$anonfun$15) + }) + dotty.tools.dotc.ast.untpd.cpy().Apply(tree, + fun1 + , args1, ctx).withType(mt.resultType(), ctx). + asInstanceOf + [ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + ] + } + } + } else case331() + } + case321() + } + } + } + } + } + if + selector119.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + then { + val fun1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = + selector119.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + { + { + fun1 + } + } + } else case351() + } + case341() + } + } + } + def typedSeqLiteral( + val tree: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$SeqLiteral + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$SeqLiteral = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt(), ctx) + , ctx) + def typedValDef( + val vdef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$ValDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$ValDef = + super.typedValDef({ + val name$3: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$TermName + = dotty.tools.dotc.ast.untpd.cpy().ValDef$default$2(vdef) + val tpt$1: + dotty.tools.dotc.ast.untpd.dotty$tools$dotc$ast$untpd$$TypedSplice + = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2(), ctx).withPos( + vdef.tpt().pos() + ).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + ) + val rhs$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.ast.untpd.cpy().ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy().ValDef(vdef, name$3, tpt$1, rhs$1) + }, sym, ctx) + def typedDefDef( + val ddef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + val restpe: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx).resultType() + val ddef1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + = + { + val name$4: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$TermName + = dotty.tools.dotc.ast.untpd.cpy().DefDef$default$2(ddef) + val vparamss$1: scala.collection.immutable.List = { + val $7$: scala.collection.immutable.List = + ddef.vparamss().flatten($conforms()).asInstanceOf[ + scala.collection.immutable.List + ] + scala.package.Nil().::($7$) + } + val tpt$2: + dotty.tools.dotc.ast.untpd.dotty$tools$dotc$ast$untpd$$TypedSplice + = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2() + , ctx).withPos(ddef.tpt().pos()).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + ) + val rhs$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + { + val selector120: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = ddef.rhs() + { + def case361(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case371(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail201(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector120) + { + { + ddef.rhs() + } + } + } + if + selector120.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Ident + ] + then { + val x211: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Ident + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + { + val o62: Option = + dotty.tools.dotc.ast.Trees.Ident.unapply( + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + ) + if o62.isDefined() then { + val x39: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = + o62.get().asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + ] + { + val p47: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = x39 + if + dotty.tools.dotc.core.StdNames.nme().WILDCARD().equals + ( + p47) + then { + val x54: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TermName + = + p47.asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TermName + ] + { + val id: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + { + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe, ctx) + ) + } + } + } else case371() + } + } else case371() + } + } else case371() + } + case361() + } + } + dotty.tools.dotc.ast.untpd.cpy().DefDef(ddef, name$4, + scala.package.Nil() + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym, ctx) + } + def typedTypeDef( + val tdef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.tpd.EmptyTree() + def typedStats(val stats: scala.collection.immutable.List, + val exprOwner: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): scala.collection.immutable.List = { + val stats1: scala.collection.immutable.List = + dotty.tools.dotc.ast.Trees.flatten( + super.typedStats(stats, exprOwner, ctx) + ) + if ctx.owner().isClass() then { + val $8$: scala.collection.immutable.List = stats1 + Typer.this.addBridges(stats, stats1, ctx).:::($8$) + } else stats1 + } + def addBridges(val oldStats: scala.collection.immutable.List, + val newStats: scala.collection.immutable.List + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): scala.collection.immutable.List = { + val beforeCtx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase() + ) + Typer.this.traverse$1(ctx, beforeCtx, newStats, oldStats, + traverse$default$3$1() + ) + } + def makeBridgeDef( + val newDef: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + val bridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = + { + val owner$3: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + () + val name$5: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = parentSym.name(ctx) + val flags$1: + dotty.tools.dotc.core.Flags.dotty$tools$dotc$core$Flags$$FlagSet + = + dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).flags(ctx).| + ( + dotty.tools.dotc.core.Flags.Bridge()) + val info$3: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ctx.newSymbol$default$5() + ctx.newSymbol(owner$3, name$5, flags$1, info$3, privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().coord() + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase().prev().asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers. + dotty$tools$dotc$core$DenotTransformers$$DenotTransformer + ] + , ctx) + ctx.debuglog({ + closure(newDef, ctx, bridge | Typer.this.$anonfun$makeBridgeDef$1: + Function0 + ) + }) + val sel: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().asClass() + , ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + termRef + (ctx) + , ctx) + val resultType: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.Symbols.toDenot(bridge, ctx).info(ctx).widen(ctx + ) + .resultType() + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + closure(newDef, parentSym, ctx, sel, resultType | + Typer.this.$anonfun$makeBridgeDef$2 + ) + } + }, ctx) + } + def adapt( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val original: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val printer$1: + dotty.tools.dotc.config.Printers. + dotty$tools$dotc$config$Printers$$Printer + = ctx.traceIndented$default$2() + ctx.traceIndented({ + closure(tree, pt, ctx | Typer.this.$anonfun$adapt$1:Function0) + }, printer$1, true, { + closure(tree, pt, ctx | Typer.this.$anonfun$adapt$2:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + } + def $anonfun$promote$1( + val tree$8: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$12: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val erased$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): String = + StringContext.apply( + Predef.wrapRefArray(["promoting ",": ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree$8.show(ctx$12) + },{ + erased$1.showWithUnderlying( + erased$1.showWithUnderlying$default$1() + , ctx$12) + }] + ): + ) + def $anonfun$typedSelect$1( + val tree$9: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , + val ctx$13: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = tree$9.show(ctx$13) + def select$1( + val tree$10: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , + val ctx$14: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val name: dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = + { + val selector111: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = tree$10.typeOpt() + { + def case201(): + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = { + def case211(): + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = { + def matchFail111(): + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = throw new MatchError(selector111) + { + { + sym.name(ctx$14) + } + } + } + if + selector111.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + ] + then { + val tp: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + = + selector111.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + ] + { + if + dotty.tools.dotc.core.NameOps.NameDecorator(tp.name()). + isInheritedName + () + then { + dotty.tools.dotc.core.NameOps.NameDecorator(sym.name(ctx$14) + ) + .inheritedName() + } else case211() + } + } else case211() + } + case201() + } + } + dotty.tools.dotc.ast.untpd.cpy().Select(tree$10, qual, sym.name(ctx$14) + , + ctx$14).withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ] + , sym, ctx$14) + , ctx$14) + } + def selectArrayMember$1( + val tree$11: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt$3: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$15: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val erasedPre: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel14( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val erasedPre: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx$15).ObjectClass() + , ctx$15) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator(tree$11.name()). + genericArrayOp + () + , pt$3, Predef.wrapRefArray([qual]): , ctx$15) + else + if + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].<:<(erasedPre, ctx$15).unary_!() + then + tailLabel14($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, erasedPre, + ctx$15 + ) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy().Select(tree$11, qual, + dotty.tools.dotc.core.NameOps.NameDecorator(tree$11.name()). + primitiveArrayOp + () + , ctx$15) + , qual, ctx$15) + tailLabel14(Typer.this, qual, erasedPre) + } + def adaptIfSuper$1( + val ctx$16: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + val selector113: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = qual + { + def case231(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case241(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def matchFail131(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = throw new MatchError(selector113) + { + { + qual + } + } + } + if + selector113.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + ] + then { + val x28: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + = + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + ] + { + val o61: Option = + dotty.tools.dotc.ast.Trees.Super.unapply( + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Super + ] + ) + if o61.isDefined() then { + val x37: Tuple2 = o61.get().asInstanceOf[Tuple2] + { + val thisQual: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x37._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p46: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + = + x37._2().asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + ] + if + dotty.tools.dotc.core.StdNames.tpnme().EMPTY().equals(p46) + then { + val x53: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + = + p46: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + { + { + val $4$: Tuple2 = { + val selector112: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ]: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + { + def case221(): Tuple2 = { + def matchFail121(): Tuple2 = + throw new MatchError(selector112) + if + selector112.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + then { + val x27: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + = + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + { + val o42: Option = + dotty.tools.dotc.core.Types.SuperType. + unapply + ( + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + ) + if o42.isDefined() then { + val x36: Tuple2 = + o42.get().asInstanceOf[Tuple2] + { + val thisType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x36._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val supType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x36._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + Tuple2.apply(thisType, supType) + } + } + } else matchFail121() + } + } else matchFail121() + } + case221() + } + } + val thisType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $4$._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val supType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $4$._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$1, + ctx$16 + ).owner() + , ctx$16).is(dotty.tools.dotc.core.Flags.Trait(), + ctx$16 + ) + then + dotty.tools.dotc.ast.tpd.cpy().Super(qual, thisQual + , + dotty.tools.dotc.core.Symbols.toDenot(sym$1, ctx$16) + . + owner().asClass().name(ctx$16).asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + ] + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$1, + ctx$16 + ).owner() + , ctx$16).typeRef(ctx$16) + , ctx$16) + , ctx$16) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , thisType.firstParent(ctx$16), ctx$16) + , ctx$16) + } + } + } else case241() + } + } else case241() + } + } else case241() + } + case231() + } + } + def $anonfun$9( + val ctx$18: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply(Predef.wrapRefArray(["",""]): ).s( + Predef.wrapRefArray( + [{ + sym$3.showLocated(ctx$18) + }] + ): + ) + def recur$1( + val tree$12: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt$4: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$17: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def tailLabel16( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree) + : + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$17) + ).isPrimitiveValueType(ctx$17) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner() + , ctx$17).isPrimitiveValueClass(ctx$17) + if + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx$17).AnyClass() + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx$17).AnyValClass() + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).isConstructor + ( + ) + , { + closure(ctx$17, sym$2 | Typer.this.$anonfun$9:Function0) + }) + Typer.this.select$1(tree$12, ctx$17, qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx$17).ObjectClass() + , ctx$17).info(ctx$17).decl(sym$2.name(ctx$17), ctx$17).symbol() + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!()).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + ).isErasedValueType(ctx$17) + ) + then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, { + closure($anonfun$17:Function0) + }, ctx$17) + ) + else + if qualIsPrimitive.unary_!().&&(symIsPrimitive) then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner + ( + ) + , ctx$17).typeRef(ctx$17) + , ctx$17) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner(). + eq + (dotty.tools.dotc.core.Symbols.defn(ctx$17).ArrayClass()) + then + Typer.this.selectArrayMember$1(tree$12, pt$4, ctx$17, qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree$12.qualifier().typeOpt().widen(ctx$17). + finalResultType + () + , ctx$17) + ) + else { + val qual1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = Typer.this.adaptIfSuper$1(ctx$17, sym$2, qual) + if + qual1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner + ( + ) + , ctx$17).||( + qual1.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Super + ] + ) + then Typer.this.select$1(tree$12, ctx$17, qual1, sym$2) else + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17). + owner + () + , ctx$17).typeRef(ctx$17) + , ctx$17) + ) + } + } + tailLabel16(Typer.this, qual) + } + def $anonfun$typedThis$1( + val tree$13: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + , + val ctx$19: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["computing outer path from ","%, % to ",", encl class = ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx$19.owner(), ctx$19). + ownersIterator + (ctx$19).toList() + },{ + tree$13.symbol(ctx$19) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx$19.owner(), ctx$19). + enclosingClass + (ctx$19) + }] + ): + , ctx$19) + def $anonfun$7( + val ctx$20: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.typedExpr(tree, pt, ctx$20) + def $anonfun$12( + val ctx$21: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , _$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = Typer.this.typedType(_$1, Typer.this.typedType$default$2(), ctx$21) + def $anonfun$15( + val ctx$22: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.typedExpr(tree, pt, ctx$22) + def $anonfun$6( + val ctx$24: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$2: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val oldSymbol$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newSymbol$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply( + Predef.wrapRefArray([""," bridging with ",""]): + ).s( + Predef.wrapRefArray( + [{ + oldSymbol$1.name(beforeCtx$2) + },{ + newSymbol$1.name(ctx$24) + }] + ): + ) + def stillInBaseClass$1( + val ctx$25: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(ctx$25.owner(), ctx$25). + derivesFrom + (dotty.tools.dotc.core.Symbols.toDenot(sym, ctx$25).owner(), ctx$25) + def $anonfun$16( + val ctx$43: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = Typer.this.stillInBaseClass$1(ctx$43, sym) + def $anonfun$20( + val ctx$27: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + nxtBridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(bridge$1, ctx$27).info(ctx$27).=:= + ( + dotty.tools.dotc.core.Symbols.toDenot(nxtBridge, ctx$27).info(ctx$27), + ctx$27 + ).unary_!() + def $anonfun$8( + val ctx$28: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : Boolean = { + sym.name(ctx$28).eq(bridge$2.name(ctx$28)).&&( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx$28).info(ctx$28).widen( + ctx$28 + ).=:=( + dotty.tools.dotc.core.Symbols.toDenot(bridge$2, ctx$28).info(ctx$28) + . + widen(ctx$28) + , ctx$28) + ) + } + def $anonfun$$anonfun$19$1( + val ctx$30: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$4: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val stat: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef) + : + Boolean = + stat.name().==(bridge$4.name(ctx$30)).&&( + stat.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$30).=:=( + dotty.tools.dotc.core.Symbols.toDenot(bridge$4, ctx$30).info(ctx$30) + . + widen(ctx$30) + , ctx$30) + ) + def $anonfun$$anonfun$2( + val ctx$31: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val _$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef) + : + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + _$2.symbol(ctx$31) + def $anonfun$19( + val ctx$29: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val emittedBridges$2: scala.collection.mutable.ListBuffer, + val bridge$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Option = + emittedBridges$2.find({ + closure(ctx$29, bridge$3 | Typer.this.$anonfun$$anonfun$19$1) + }).map({ + closure(ctx$29 | Typer.this.$anonfun$$anonfun$2) + }) + def $anonfun$14( + val ctx$32: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$4: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val newSymbol$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val bridge$5: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val cl$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["bridge for method "," of type ","\\n"]): + + ) + ).i( + Predef.wrapRefArray( + [{ + newSymbol$3.showLocated(beforeCtx$4) + },{ + dotty.tools.dotc.core.Symbols.toDenot(newSymbol$3, ctx$32).info( + beforeCtx$4 + ) + }] + ): + , ctx$32).+( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["clashes with "," of type ","\\n"]): + + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(cl$1, ctx$32).symbol(). + showLocated + (beforeCtx$4) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(cl$1, ctx$32).symbol() + , ctx$32).info(beforeCtx$4) + }] + ): + , ctx$32) + ).+( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["both have same type after erasure: ",""]): + + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(bridge$5, ctx$32).symbol + ( + ) + , ctx$32).info(ctx$32) + }] + ): + , ctx$32) + ) + def $anonfun$3( + val ctx$26: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$3: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val emittedBridges$1: scala.collection.mutable.ListBuffer, + val oldSymbol$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newSymbol$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val minimalSet$1: scala.runtime.ObjectRef, + val bridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Unit = { + val isRequired: Boolean = + minimalSet$1.elem.asInstanceOf[scala.collection.immutable.Set].forall( + { + closure(ctx$26, bridge | Typer.this.$anonfun$20) + }) + if isRequired then { + val clash: Option = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(oldSymbol$2, ctx$26).owner() + , ctx$26).decls(ctx$26).lookupAll(bridge.name(ctx$26), ctx$26).find( + { + { + closure(ctx$26, bridge | Typer.this.$anonfun$8) + } + }).orElse({ + closure(ctx$26, emittedBridges$1, bridge | Typer.this.$anonfun$19: + Function0 + ) + }) + { + val selector121: Option = clash + { + def case381(): Unit = { + def case391(): Unit = { + def matchFail211(): Unit = throw new MatchError(selector121) + if None.equals(selector121) then { + val x41: None$ = selector121.asInstanceOf[None$] + { + { + minimalSet$1.elem = + minimalSet$1.elem.asInstanceOf[ + scala.collection.immutable.Set + ].+(bridge).asInstanceOf[ + scala.collection.immutable.Set + ] + } + } + } else matchFail211() + } + if selector121.isInstanceOf[Some] then { + val x212: Some = selector121.asInstanceOf[Some] + { + val o53: Option = + Some.unapply(selector121.asInstanceOf[Some]) + if o53.isDefined() then { + val x310: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + o53.get().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + ] + { + val cl: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = x310 + { + { + ctx$26.error({ + closure(ctx$26, beforeCtx$3, newSymbol$2, bridge, + cl + | Typer.this.$anonfun$14:Function0) + }, ctx$26.error$default$2()) + } + } + } + } else case391() + } + } else case391() + } + case381() + } + } + } else () + } + def $anonfun$18( + val ctx$33: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val $this$1: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , + val member$1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + $this$1.makeBridgeDef(member$1, sym, ctx$33) + } + def traverse$1( + val ctx$23: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$1: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + def tailLabel30( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + { + val selector123: scala.collection.immutable.List = after + { + def case431(): scala.collection.immutable.List = { + def case441(): scala.collection.immutable.List = { + def case451(): scala.collection.immutable.List = { + def matchFail231(): scala.collection.immutable.List = + throw new MatchError(selector123) + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x65: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.::] + { + val o82: Option = + scala.package.::().unapply( + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o82.isDefined() then { + val x73: Tuple2 = o82.get().asInstanceOf[Tuple2] + { + val newTail: scala.collection.immutable.List = + x73._2().asInstanceOf[ + scala.collection.immutable.List + ] + { + { + tailLabel30($this, newTail, before, + traverse$default$3$1() + ) + } + } + } + } else matchFail231() + } + } else matchFail231() + } + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x312: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.::] + { + val o94: Option = + scala.package.::().unapply( + selector123.asInstanceOf[scala.collection.immutable.:: + ] + ) + if o94.isDefined() then { + val x43: Tuple2 = o94.get().asInstanceOf[Tuple2] + { + val pi52: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x43._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val newTail: scala.collection.immutable.List = + x43._2().asInstanceOf[ + scala.collection.immutable.List + ] + if + pi52.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + then { + val member: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + = + pi52.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + { + { + { + val selector122: + scala.collection.immutable.List + = before + { + def case401(): + scala.collection.immutable.List + = { + def case411(): + scala.collection.immutable.List + = { + def case421(): + scala.collection.immutable.List + = { + def matchFail221(): + scala.collection.immutable.List + = throw new MatchError(selector122) + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x64: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o81: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable. + :: + ] + ) + if o81.isDefined() then { + val x72: Tuple2 = + o81.get().asInstanceOf[Tuple2] + { + val oldTail: + scala.collection.immutable. + List + = + x72._2().asInstanceOf[ + scala.collection.immutable + . + List + ] + { + { + tailLabel30($this, after, + oldTail + , traverse$default$3$1()) + } + } + } + } else matchFail221() + } + } else matchFail221() + } + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x311: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o93: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o93.isDefined() then { + val x42: Tuple2 = + o93.get().asInstanceOf[Tuple2] + { + val pi51: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x42._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val oldTail: + scala.collection.immutable. + List + = + x42._2().asInstanceOf[ + scala.collection.immutable. + List + ] + if + pi51.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + then { + val oldMember: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + = + pi51.asInstanceOf[ + dotty.tools.dotc.ast.Trees + . + dotty$tools$dotc$ast$Trees$$DefDef + ] + { + { + val oldSymbol: + dotty.tools.dotc.core.Symbols + . + dotty$tools$dotc$core$Symbols$$Symbol + = + oldMember.symbol( + beforeCtx$1 + ) + val newSymbol: + dotty.tools.dotc.core.Symbols + . + dotty$tools$dotc$core$Symbols$$Symbol + = member.symbol(ctx$23) + assert( + oldSymbol.name( + beforeCtx$1 + ).==( + newSymbol.name(ctx$23) + ) + , { + closure(ctx$23, + beforeCtx$1 + , oldSymbol, newSymbol + | + Typer.this.$anonfun$6: + Function0 + ) + }) + val newOverridden: + scala.collection.immutable + . + Set + = + oldSymbol.denot(ctx$23). + allOverriddenSymbols + (ctx$23).toSet() + val oldOverridden: + scala.collection.immutable + . + Set + = + dotty.tools.dotc.core. + Symbols + .toDenot(newSymbol, + ctx$23 + ).allOverriddenSymbols( + beforeCtx$1 + ).toSet() + val neededBridges: + scala.collection.immutable + . + Set + = + oldOverridden.--( + newOverridden + ).asInstanceOf[ + scala.collection. + TraversableLike + ].filter({ + closure(ctx$23 | + Typer.this. + $anonfun$16 + ) + }).asInstanceOf[ + scala.collection.immutable + . + Set + ] + val minimalSet: + scala.runtime.ObjectRef + = + scala.runtime.ObjectRef$ + # + create( + Set().apply( + Predef. + genericWrapArray + ([]): + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + ) + neededBridges.foreach({ + closure(ctx$23, + beforeCtx$1 + , emittedBridges, + oldSymbol + , newSymbol, minimalSet + | + Typer.this.$anonfun$3) + }) + val bridgeImplementations + : + scala.collection.immutable + . + Set + = + minimalSet.elem. + asInstanceOf + [ + scala.collection.immutable + . + Set + ].map({ + { + closure(ctx$23, + $this + , member | + Typer.this. + $anonfun$18 + ) + } + }, + scala.collection.immutable + . + Set.canBuildFrom() + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + emittedBridges.++=( + bridgeImplementations + ) + tailLabel30($this, newTail + , + oldTail, + traverse$default$3$1() + ) + } + } + } else case421() + } + } else case421() + } + } else case421() + } + if scala.package.Nil().equals(selector122) + then + { + val x213: + scala.collection.immutable.Nil$ + = + selector122.asInstanceOf[ + scala.collection.immutable.Nil$ + ] + { + { + emittedBridges.toList() + } + } + } else case411() + } + case401() + } + } + } + } + } else case451() + } + } else case451() + } + } else case451() + } + if scala.package.Nil().equals(selector123) then { + val x214: scala.collection.immutable.Nil$ = + selector123.asInstanceOf[scala.collection.immutable.Nil$] + { + { + emittedBridges.toList() + } + } + } else case441() + } + case431() + } + } + } + tailLabel30(Typer.this, after, before, emittedBridges) + } + def $anonfun$error$1( + val newDef$2: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$35: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val reason$1: String): String = + StringContext.apply( + Predef.wrapRefArray( + ["failure creating bridge from "," to ",", reason: ",""] + ): + ).s( + Predef.wrapRefArray( + [{ + newDef$2.symbol(ctx$35) + },{ + parentSym$2 + },reason$1] + ): + ) + def error$1( + val newDef$1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$34: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val reason: String): Nothing = { + assert(false, { + closure(newDef$1, parentSym$1, ctx$34, reason | + Typer.this.$anonfun$error$1 + :Function0) + }) + ???() + } + def $anonfun$makeBridgeDef$1( + val newDef$3: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val ctx$36: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$6: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply( + Predef.wrapRefArray(["generating bridge from "," to ",""]): + ).s( + Predef.wrapRefArray( + [{ + newDef$3.symbol(ctx$36) + },bridge$6] + ): + ) + def $anonfun$$anonfun$1( + val ctx$39: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , _$3: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + _$4: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.adapt(_$3, _$4, dotty.tools.dotc.ast.untpd.EmptyTree(), + ctx$39 + ) + def $anonfun$21( + val newDef$5: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$4: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$38: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , fun: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + vparams: scala.collection.immutable.List + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val selector124: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + fun.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$38) + { + def case461(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def case471(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def matchFail241(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = throw new MatchError(selector124) + { + val a: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = selector124 + { + Typer.this.error$1(newDef$5, parentSym$4, ctx$38, + StringContext.apply( + Predef.wrapRefArray(["can not resolve apply type ",""]): + + ).s(Predef.wrapRefArray([a]): ) + ) + } + } + } + if + selector124.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val x215: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + val o44: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + ) + if o44.isDefined() then { + val x313: Tuple2 = o44.get().asInstanceOf[Tuple2] + { + val types: scala.collection.immutable.List = + x313._2().asInstanceOf[scala.collection.immutable.List] + { + { + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps(Tuple2.apply(vparams, types)).zipped + ( + $conforms(), $conforms()).map({ + closure(ctx$38 | Typer.this.$anonfun$$anonfun$1) + }, scala.collection.immutable.List.canBuildFrom()). + asInstanceOf + [scala.collection.immutable.List] + , ctx$38) + } + } + } + } else case471() + } + } else case471() + } + case461() + } + } + def $anonfun$makeBridgeDef$2( + val newDef$4: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$37: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val sel$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val resultType$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val paramss: scala.collection.immutable.List): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + val rhs: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + paramss.foldLeft(sel$1, { + closure(newDef$4, parentSym$3, ctx$37 | Typer.this.$anonfun$21) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + Typer.this.adapt(rhs, resultType$1, Typer.this.adapt$default$3(), ctx$37 + ) + } + def $anonfun$adapt$1( + val tree$14: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$5: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$40: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["adapting ",": "," to ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$14.showSummary(ctx$40) + },{ + tree$14.tpe() + },pt$5] + ): + , ctx$40) + def $anonfun$$anonfun$adapt$2$1( + val ctx$42: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Phases.dotty$tools$dotc$core$Phases$$Phase = + ctx$42.phase() + def $anonfun$adapt$2( + val tree$15: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$6: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$41: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + assert( + ctx$41.phase().==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx$41).erasurePhase() + . + next() + ) + , { + closure(ctx$41 | Typer.this.$anonfun$$anonfun$adapt$2$1:Function0) + }) + if tree$15.isEmpty() then tree$15 else + if ctx$41.mode().is(dotty.tools.dotc.typer.Mode.Pattern()) then + tree$15 + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree$15, pt$6 + , + ctx$41) + } + } + class Typer$ extends Object { + this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + => + + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + = { + Typer$.super() + () + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after TreeTransform:{collectEntryPoints, labelDef}: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure extends dotty.tools.dotc.util.DotClass with + dotty.tools.dotc.core.Phases + .dotty$tools$dotc$core$Phases$$Phase with + dotty.tools.dotc.core.DenotTransformers + .dotty$tools$dotc$core$DenotTransformers$$DenotTransformer { + thisTransformer: dotty.tools.dotc.transform.Erasure => + + def (): dotty.tools.dotc.transform.Erasure = { + Erasure.super() + Erasure.super[Phase]() + Erasure.super[DenotTransformer]() + Erasure.this.eraser$$local = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + () + () + } + def myPeriod(): + dotty.tools.dotc.core.Periods.dotty$tools$dotc$core$Periods$$Period + = Erasure.super[Phase].initial$myPeriod() + def myBase(): + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$ContextBase + = Erasure.super[Phase].initial$myBase() + def myErasedTypes(): Boolean = + Erasure.super[Phase].initial$myErasedTypes() + def myFlatClasses(): Boolean = + Erasure.super[Phase].initial$myFlatClasses() + def myRefChecked(): Boolean = Erasure.super[Phase].initial$myRefChecked() + def mySymbolicRefs(): Boolean = + Erasure.super[Phase].initial$mySymbolicRefs() + def myPeriod_=( + val x$1: + dotty.tools.dotc.core.Periods.dotty$tools$dotc$core$Periods$$Period + ): Unit = () + def myBase_=( + val x$1: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$ContextBase + ): Unit = () + def myErasedTypes_=(val x$1: Boolean): Unit = () + def myFlatClasses_=(val x$1: Boolean): Unit = () + def myRefChecked_=(val x$1: Boolean): Unit = () + def mySymbolicRefs_=(val x$1: Boolean): Unit = () + def toString(): String = Erasure.super[Phase].toString() + def phaseName(): String = "erasure" + def runsAfter(): scala.collection.immutable.Set = + Set().apply( + Predef.wrapRefArray([classOf(),classOf(),classOf()]): + ).asInstanceOf[scala.collection.immutable.Set] + def transform( + val ref: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + val selector12: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = ref + { + def case21(): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + def case31(): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + { + val ref: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = selector12 + { + ref.derivedSingleDenotation(ref.symbol(), + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx), + ctx + ) + , ctx) + } + } + } + if + selector12.isInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ] + then { + val ref: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + = + selector12.asInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ] + { + { + assert(ctx.phase().==(this), { + closure(ctx, ref | Erasure.this.$anonfun$13:Function0) + }) + if + ref.symbol().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + ) + then { + val $1$: Tuple4 = { + val selector11: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + ref.info(ctx): + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + { + def case11(): Tuple4 = { + def matchFail11(): Tuple4 = + throw new MatchError(selector11) + if + selector11.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + then { + val x21: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + = + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + { + val o51: Option = + dotty.tools.dotc.core.Types.ClassInfo.unapply( + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + ) + if o51.isDefined() then { + val x31: Tuple5 = o51.get().asInstanceOf[Tuple5] + { + val pre: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x31._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val ps: scala.collection.immutable.List = + x31._3().asInstanceOf[ + scala.collection.immutable.List + ] + val decls: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + = + x31._4().asInstanceOf[ + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass + = + x31._5().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + { + val p41: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x31._2().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + Tuple4.apply(pre, ps, decls, selfInfo) + } + } + } else matchFail11() + } + } else matchFail11() + } + case11() + } + } + val pre: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $1$._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val ps: scala.collection.immutable.List = + $1$._2().asInstanceOf[scala.collection.immutable.List] + val decls: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + = + $1$._3().asInstanceOf[ + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass = + $1$._4().asInstanceOf[dotty.tools.dotc.util.DotClass] + val extendedScope: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$MutableScope + = decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + , ctx).classInfo(ctx).decls().foreach({ + closure(ctx, extendedScope | + Erasure.this.$anonfun$transform$1 + ) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$1() + val owner$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$2() + val name$1: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = ref.copySymDenotation$default$3() + val initFlags$1: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = ref.copySymDenotation$default$4() + val info$1: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass( + ) + , ps, extendedScope, selfInfo, ctx) + , ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$6() + val annotations$1: scala.collection.immutable.List = + ref.copySymDenotation$default$7() + ref.copySymDenotation(symbol$1, owner$1, name$1, + initFlags$1 + , info$1, privateWithin$1, annotations$1, ctx) + } + } else { + val oldOwner: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.owner() + val newOwner: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + if + oldOwner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + ) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + else oldOwner + val oldInfo: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = ref.info(ctx) + val newInfo: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , oldInfo, ctx) + val oldFlags: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = ref.flags(ctx) + val newFlags: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = + ref.flags(ctx).&~( + dotty.tools.dotc.core.Flags.HasDefaultParams() + ) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass(), ctx). + unary_! + () + , { + closure(ctx, ref, oldOwner, newOwner, oldInfo, newInfo + | + Erasure.this.$anonfun$2:Function0) + }) + { + val symbol$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$1() + val owner$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = newOwner + val name$2: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = ref.copySymDenotation$default$3() + val initFlags$2: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = newFlags + val info$2: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, + initFlags$2 + , info$2, ref.copySymDenotation$default$6(), + ref.copySymDenotation$default$7() + , ctx) + } + } + } + } + } + } else case31() + } + case21() + } + } + val eraser$$local: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + def eraser(): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + = Erasure.this.eraser$$local + def run( + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit() + unit.tpdTree_=( + Erasure.this.eraser().typedExpr(unit.tpdTree(), + Erasure.this.eraser().typedExpr$default$2() + , ctx.fresh().setPhase(this.next())) + ) + } + def checkPostCondition( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + Erasure.this.assertErased(tree, ctx) + { + val selector13: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = tree + { + def case41(): Unit = { + def case51(): Unit = { + { + { + () + } + } + } + if + selector13.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + ] + then { + val res: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + = + selector13.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + ] + { + { + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + , res, ctx).unary_!() + , { + closure(ctx, res | Erasure.this.$anonfun$1:Function0) + }) + } + } + } else case51() + } + case41() + } + } + } + def assertErased( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt(), tree, ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure(). + apply + (tree.symbol(ctx)).unary_!() + then Erasure.this.assertErased(tree.typeOpt().widen(ctx), tree, ctx) + else + () + if ctx.mode().isExpr() then { + val selector14: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ] + { + def case61(): Unit = { + def case71(): Unit = { + { + { + () + } + } + } + if + selector14.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + then { + val ref: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + = + selector14.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + { + { + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$UniqueRefDenotation + ] + ) + , { + closure(tree, ctx, ref | Erasure.this.$anonfun$5:Function0 + ) + }) + } + } + } else case71() + } + case61() + } + } else () + } + def assertErased( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp, ctx), { + closure(tp, tree, ctx | Erasure.this.$anonfun$assertErased$1:Function0 + ) + }) + def assertErased$default$2(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Thicket + = dotty.tools.dotc.ast.tpd.EmptyTree() + def $anonfun$13( + val ctx$1: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$1: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ): String = + StringContext.apply( + Predef.wrapRefArray(["transforming "," at ",""]): + ).s( + Predef.wrapRefArray( + [ref$1,{ + ctx$1.phase().asInstanceOf[dotty.tools.dotc.util.DotClass] + }] + ): + ) + def $anonfun$transform$1( + val ctx$2: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val extendedScope$1: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$MutableScope + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + extendedScope$1.enter(sym, ctx$2) + def $anonfun$2( + val ctx$3: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$2: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + , + val oldOwner$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newOwner$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val oldInfo$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val newInfo$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): String = + StringContext.apply( + Predef.wrapRefArray( + ["trans "," @ "," oldOwner = ",", newOwner = ",", oldInfo = ", + ", newInfo = " + ," "," ",""] + ): + ).s( + Predef.genericWrapArray( + [ref$2,{ + ctx$3.phase() + },oldOwner$1,newOwner$1,oldInfo$1,newInfo$1,{ + scala.Boolean.box(oldOwner$1.eq(newOwner$1)) + },{ + scala.Boolean.box(oldInfo$1.eq(newInfo$1)) + }] + ): + ) + def $anonfun$1( + val ctx$4: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val res$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This) + : + String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["Reference to "," from ",""]): + ) + ).i( + Predef.wrapRefArray( + [res$1,{ + ctx$4.owner().showLocated(ctx$4) + }] + ): + , ctx$4) + def $anonfun$5( + val tree$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$5: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$3: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["non-sym type "," of class "," with denot of class "," of ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [ref$3,{ + ref$3.getClass() + },{ + ref$3.denot(ctx$5).getClass() + },tree$1] + ): + , ctx$5) + def $anonfun$assertErased$1( + val tp$1: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val tree$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$6: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""] + ): + ) + ).i( + Predef.wrapRefArray( + [tp$1,{ + tp$1.toString() + },{ + tp$1.getClass() + },tree$2,{ + tree$2.tpe() + },{ + tree$2.getClass() + },{ + ctx$6.phase() + }] + ): + , ctx$6) + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$ extends Object with dotty.tools.dotc.transform.TypeTestsCasts + + { this: => + def (): dotty.tools.dotc.transform.Erasure$ = { + Erasure$.super() + Erasure$.super[TypeTestsCasts]() + () + } + val Boxing: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + () + val Typer: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + () + def $anonfun$10(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def $anonfun$4(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def $anonfun$17(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def traverse$default$3$1(): scala.collection.mutable.ListBuffer = + collection.mutable.ListBuffer.apply( + Predef.genericWrapArray([]): + ).asInstanceOf[scala.collection.mutable.ListBuffer] + } + class Boxing$ extends Object { this: => + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + = { + Boxing$.super() + () + } + def isUnbox( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().unbox()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses().contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def isBox( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().box()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses().contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def boxMethod( + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().box(), ctx) + . + symbol() + def unboxMethod( + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().unbox(), + ctx + ).symbol() + def safelyRemovableUnboxArg( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val selector15: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = tree + { + def case81(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case91(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + dotty.tools.dotc.ast.tpd.EmptyTree() + } + } + } + if + selector15.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + then { + val x22: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + { + val o101: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply( + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + ] + ) + if o101.isDefined() then { + val x32: Tuple2 = o101.get().asInstanceOf[Tuple2] + { + val fn: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x32._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p42: scala.collection.immutable.List = + x32._2().asInstanceOf[scala.collection.immutable.List] + if p42.isInstanceOf[scala.collection.immutable.::] then { + val x51: scala.collection.immutable.:: = + p42.asInstanceOf[scala.collection.immutable.::] + { + val o91: Option = + scala.package.::().unapply( + p42.asInstanceOf[scala.collection.immutable.::] + ) + if o91.isDefined() then { + val x61: Tuple2 = o91.get().asInstanceOf[Tuple2] + { + val arg: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x61._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p71: scala.collection.immutable.List = + x61._2().asInstanceOf[ + scala.collection.immutable.List + ] + if scala.package.Nil().equals(p71) then { + val x81: scala.collection.immutable.Nil$ = + p71.asInstanceOf[scala.collection.immutable.Nil$ + ] + { + if + dotty.tools.dotc.transform.Erasure.Boxing. + isUnbox + (fn.symbol(ctx), ctx).&&( + dotty.tools.dotc.core.Symbols.defn(ctx). + ScalaBoxedClasses + ().contains( + arg.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx).typeSymbol(ctx) + ) + ) + then { + arg + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + case81() + } + } + def constant( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val const: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree, ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + tree + scala.package.Nil().::($2$) + }, const, ctx) + def box( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val target: Function0, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + ctx.traceIndented({ + closure(tree, target, ctx | $anonfun$box$2:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + closure(tree, ctx | $anonfun$box$1:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + def box$default$2(): String = "" + def unbox( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + ctx.traceIndented({ + closure(tree, pt, ctx | $anonfun$unbox$1:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + closure(tree, pt, ctx | $anonfun$unbox$2:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + def cast( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel11( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass(), ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt, ctx) else { + val selector18: Tuple2 = Tuple2.apply(tree.tpe(), pt) + { + def case141(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case151(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + pt + ).isPrimitiveValueType(ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + , ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps(tree).asInstance(pt, + ctx + ) + } + } + } + { + val o111: Option = Tuple2.unapply(selector18) + if o111.isDefined() then { + val x25: Tuple2 = o111.get().asInstanceOf[Tuple2] + { + val p31: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x25._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val p44: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x25._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + if + p31.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + then { + val x52: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + = + p31.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + { + val o102: Option = + dotty.tools.dotc.core.Types.JavaArrayType.unapply( + p31.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + ) + if o102.isDefined() then { + val x62: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + o102.get().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + val treeElem: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = x62 + if + p44.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + then { + val x71: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + = + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + { + val o92: Option = + dotty.tools.dotc.core.Types.JavaArrayType. + unapply + ( + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + ) + if o92.isDefined() then { + val x82: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + o92.get().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + val ptElem: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = x82 + { + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (treeElem.widen(ctx)). + isPrimitiveValueType + (ctx).&&( + dotty.tools.dotc.transform.TypeUtils + . + decorateTypeUtils(ptElem). + isPrimitiveValueType + (ctx).unary_!() + ) + then { + tailLabel11($this, + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols. + defn + (ctx).runtimeMethod( + dotty.tools.dotc.core.StdNames + . + nme().toObjectArray() + ) + , ctx) + ).appliedTo(tree, ctx) + , pt, ctx) + } else case151() + } + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } + case141() + } + } + } + tailLabel11(Boxing$.this, tree, pt, ctx) + } + def adaptToType( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel12( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + pt.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + then tree else { + val selector19: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case161(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case171(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + val tpw: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = selector19 + { + if + pt.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ProtoType + ].||( + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].<:<(pt, ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + tpw).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + { + closure($anonfun$10:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box( + tree + , { + closure($anonfun$4:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, pt, ctx) + , pt, ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree + , pt, ctx) + } + } + } + if + selector19.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val x26: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + val o71: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + ) + if o71.isDefined() then { + val x35: Tuple2 = o71.get().asInstanceOf[Tuple2] + { + val p45: scala.collection.immutable.List = + x35._1().asInstanceOf[scala.collection.immutable.List] + if scala.package.Nil().equals(p45) then { + val x63: scala.collection.immutable.Nil$ = + p45.asInstanceOf[scala.collection.immutable.Nil$] + { + val p51: scala.collection.immutable.List = + x35._2().asInstanceOf[ + scala.collection.immutable.List + ] + if tree.isTerm() then { + tailLabel12($this, + dotty.tools.dotc.ast.tpd.TreeOps(tree). + appliedToNone + (ctx) + , pt, ctx) + } else case171() + } + } else case171() + } + } else case171() + } + } else case171() + } + case161() + } + } + tailLabel12(Boxing$.this, tree, pt, ctx) + } + def $anonfun$box$2( + val tree$3: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val target$1: Function0, + val ctx$7: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["boxing ",": "," into ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$3.showSummary(ctx$7) + },{ + tree$3.tpe() + },target$1.apply()] + ): + , ctx$7) + def $anonfun$11( + val tree$5: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$9: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val arg$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree) + : + String = + StringContext.apply( + Predef.wrapRefArray(["boxing an unbox: "," -> ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree$5.symbol(ctx$9) + },{ + arg$1.tpe().asInstanceOf[dotty.tools.dotc.util.DotClass] + }] + ): + ) + def $anonfun$box$1( + val tree$4: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$8: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + { + val selector16: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree$4.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$8) + { + def case101(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case111(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + val tp: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = selector16 + { + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = tp.classSymbol(ctx$8) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$8).UnitClass() + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree$4 + , + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx$8).BoxedUnit_UNIT + ( + ) + , ctx$8) + , ctx$8) + else + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$8).NothingClass + ( + ) + ) + then tree$4 else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx$8).ArrayClass + ( + ) + ) + ) + val arg: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree$4, ctx$8) + if arg.isEmpty() then + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + boxMethod + (cls.asClass(), ctx$8) + , ctx$8) + ).appliedTo(tree$4, ctx$8) + else { + ctx$8.log({ + closure(tree$4, ctx$8, arg | $anonfun$11:Function0) + }) + arg + } + } + } + } + } + if + selector16.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + then { + val x23: + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + = + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + { + val o52: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType.unapply( + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + ) + if o52.isDefined() then { + val x33: Tuple2 = o52.get().asInstanceOf[Tuple2] + { + val clazz: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x33._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + { + val p43: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x33._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz, + ctx$8 + ).typeRef(ctx$8) + , { + val $3$: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree$4 + , + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + ( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$8) + , ctx$8) + , ctx$8) + scala.package.Nil().::($3$) + }, ctx$8) + } + } + } + } else case111() + } + } else case111() + } + case101() + } + } + } + def $anonfun$unbox$1( + val tree$6: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$1: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$10: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["unboxing ",": "," as a ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$6.showSummary(ctx$10) + },{ + tree$6.tpe() + },pt$1] + ): + , ctx$10) + def $anonfun$unbox$2( + val tree$7: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$2: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$11: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + { + val selector17: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = pt$2 + { + def case121(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case131(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = pt$2.widen(ctx$11).classSymbol(ctx$11) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$11).UnitClass() + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree$7 + , + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply( + scala.runtime.BoxedUnit$#UNIT + ) + , ctx$11) + , ctx$11) + else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx$11).ArrayClass( + ) + ) + ) + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.unboxMethod( + cls.asClass() + , ctx$11) + , ctx$11) + ).appliedTo(tree$7, ctx$11) + } + } + } + } + if + selector17.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + then { + val x24: + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + = + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + { + val o41: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType.unapply( + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + ) + if o41.isDefined() then { + val x34: Tuple2 = o41.get().asInstanceOf[Tuple2] + { + val clazz: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x34._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + val underlying: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x34._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + { + val tree1: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + if + tree$7.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].isRef( + dotty.tools.dotc.core.Symbols.defn(ctx$11). + NullClass + () + , ctx$11).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (underlying).isPrimitiveValueType(ctx$11) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree$7 + , underlying, ctx$11) + else + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.transform.Erasure.Boxing. + adaptToType + (tree$7, + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$11).typeRef(ctx$11) + , ctx$11) + ).select( + dotty.tools.dotc.transform.ValueClasses. + valueClassUnbox + ( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$11) + , ctx$11) + , ctx$11) + ).appliedToNone(ctx$11) + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree1, + pt$2 + , ctx$11) + } + } + } + } else case131() + } + } else case131() + } + case121() + } + } + } + } + class Typer extends dotty.tools.dotc.typer.ReTyper with + dotty.tools.dotc.typer + .NoChecking { + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + = { + Typer.super() + Typer.super[NoChecking]() + () + } + def checkNonCyclic( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val info: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TypeBounds + , val reportErrors: Boolean, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkNonCyclic(sym, info, reportErrors, ctx) + def checkValue( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val proto: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.super[NoChecking].checkValue(tree, proto, ctx) + def checkBounds(val args: scala.collection.immutable.List, + val poly: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$PolyType + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkBounds(args, poly, ctx) + def checkStable( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkStable(tp, pos, ctx) + def checkLegalPrefix( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val selector: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkLegalPrefix(tp, selector, pos, ctx) + def checkClassTypeWithStablePrefix( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , val traitReq: Boolean, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkClassTypeWithStablePrefix(tp, pos, traitReq + , + ctx) + def checkImplicitParamsNotSingletons( + val vparamss: scala.collection.immutable.List + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = + Typer.super[NoChecking].checkImplicitParamsNotSingletons(vparamss, ctx) + def checkFeasible( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , val where: ()String, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkFeasible(tp, pos, + where().asInstanceOf[Function0] + , ctx) + def checkNoDoubleDefs( + val cls: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkNoDoubleDefs(cls, ctx) + def checkFeasible$default$3(): String = + Typer.super[NoChecking].checkFeasible$default$3() + def erasedType( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = { + val selector110: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = tree.typeOpt() + { + def case181(): + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = { + def case191(): + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = { + { + val tp: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = selector110 + { + dotty.tools.dotc.core.TypeErasure.erasure(tp, ctx) + } + } + } + if + selector110.isInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + ] + then { + val tp: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + = + selector110.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + { + if tree.isTerm() then { + dotty.tools.dotc.core.TypeErasure.erasedRef(tp, ctx) + } else case191() + } + } else case191() + } + case181() + } + } + def promote( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + assert(tree.hasType()) + val erased: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = Typer.this.erasedType(tree, ctx) + ctx.log({ + closure(tree, ctx, erased | Typer.this.$anonfun$promote$1:Function0) + }) + tree.withType(erased, ctx) + } + def typedLiteral( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal + , + val ctc: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal = + if + tree.typeOpt().isRef( + dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass() + , ctc) + then + tree.withType(tree.typeOpt(), ctc).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal + ] + else super.typedLiteral(tree, ctc) + def typedSelect( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).exists(), { + closure(tree, ctx | Typer.this.$anonfun$typedSelect$1:Function0) + }) + Typer.this.recur$1(tree, pt, ctx, sym, + Typer.this.typed(tree.qualifier(), + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + , ctx) + ) + } + def typedSelectFromTypeTree( + val tree: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name()).withPos(tree.pos()). + asInstanceOf + [dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree].withType( + Typer.this.erasedType(tree, ctx) + , ctx) + def typedThis( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx), ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree, ctx) else { + ctx.log({ + closure(tree, ctx | Typer.this.$anonfun$typedThis$1:Function0) + }) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs( + val name: dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val args: scala.collection.Seq + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val meth: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: scala.collection.immutable.List = + dotty.tools.dotc.core.Symbols.toDenot(meth, ctx).info(ctx). + firstParamTypes + ().drop(args.length()) + val followingArgs: scala.collection.immutable.List = + dotty.tools.dotc.core.Decorators.ListDecorator( + Typer.this.protoArgs(pt) + ).zipWithConserve(followingParams, { + closure(ctx | Typer.this.$anonfun$7) + }): scala.collection.immutable.List + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + , ctx) + ).appliedToArgs( + args.toList().++(followingArgs, + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + , ctx) + } + def protoArgs( + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): scala.collection.immutable.List = { + val selector114: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = pt + { + def case251(): scala.collection.immutable.List = { + def case261(): scala.collection.immutable.List = { + { + { + scala.package.Nil() + } + } + } + if + selector114.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + then { + val pt: + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + = + selector114.asInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + { + { + pt.args().++(Typer.this.protoArgs(pt.resultType()), + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + } + } + } else case261() + } + case251() + } + } + def typedTypeApply( + val tree: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeApply + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val ntree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeApply + , ctx) + { + val selector116: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = ntree + { + def case291(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case301(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + Typer.this.typedExpr(ntree, pt, ctx) + } + } + } + if + selector116.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + then { + val x29: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + = + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + { + val o43: Option = + dotty.tools.dotc.ast.Trees.TypeApply.unapply( + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + ) + if o43.isDefined() then { + val x38: Tuple2 = o43.get().asInstanceOf[Tuple2] + { + val fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x38._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + x38._2().asInstanceOf[scala.collection.immutable.List] + { + { + val fun1: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + , ctx) + { + val selector115: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case271(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = { + def case281(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + fun1 + } + } + } + if + selector115.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + ] + then { + val funTpe: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + = + selector115.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + ] + { + { + val args1: scala.collection.immutable.List + = + dotty.tools.dotc.core.Decorators. + ListDecorator + (args).mapconserve({ + closure(ctx | Typer.this.$anonfun$12) + }) + dotty.tools.dotc.ast.untpd.cpy().TypeApply + ( + tree, fun1, args1, ctx).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd. + ListOfTreeDecorator + (args1).tpes() + , ctx) + , ctx) + } + } + } else case281() + } + case271() + } + } + } + } + } + } else case301() + } + } else case301() + } + case291() + } + } + } + def typedApply( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val $5$: Tuple2 = { + val selector117: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + { + def case311(): Tuple2 = { + def matchFail171(): Tuple2 = throw new MatchError(selector117) + { + val o31: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply(selector117) + if o31.isDefined() then { + val x210: Tuple2 = o31.get().asInstanceOf[Tuple2] + { + val fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x210._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + x210._2().asInstanceOf[scala.collection.immutable.List] + { + Tuple2.apply(fun, args) + } + } + } else matchFail171() + } + } + case311() + } + } + val fun: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + $5$._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + $5$._2().asInstanceOf[scala.collection.immutable.List] + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply() + ) + then + Typer.this.typedUnadapted( + args.head().asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + , pt, ctx) + else { + val selector119: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this, + ctx + ) + , ctx) + { + def case341(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def case351(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + { + val fun1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = selector119 + { + { + val selector118: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case321(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + = { + def case331(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + = { + { + { + throw + new MatchError( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + Predef.wrapRefArray( + ["tree ", + " has unexpected type of function " + ,", was ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [tree,{ + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + },{ + fun.typeOpt().widen(ctx) + }] + ): + , ctx) + ) + } + } + } + if + selector118.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val mt: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector118.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + { + val outers: scala.collection.immutable.List = + dotty.tools.dotc.transform.ExplicitOuter.outer + ( + ctx).args( + fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ) + val args1: scala.collection.immutable.List = + { + val $6$: scala.collection.immutable.List = + outers + dotty.tools.dotc.core.Decorators. + ListDecorator + ( + args.++(Typer.this.protoArgs(pt), + scala.collection.immutable.List. + canBuildFrom + () + ).asInstanceOf[ + scala.collection.immutable.List + ].:::($6$) + ) + }.zipWithConserve(mt.paramTypes(), { + closure(ctx | Typer.this.$anonfun$15) + }) + dotty.tools.dotc.ast.untpd.cpy().Apply(tree, + fun1 + , args1, ctx).withType(mt.resultType(), ctx). + asInstanceOf + [ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + ] + } + } + } else case331() + } + case321() + } + } + } + } + } + if + selector119.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + then { + val fun1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = + selector119.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + { + { + fun1 + } + } + } else case351() + } + case341() + } + } + } + def typedSeqLiteral( + val tree: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$SeqLiteral + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$SeqLiteral = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt(), ctx) + , ctx) + def typedValDef( + val vdef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$ValDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$ValDef = + super.typedValDef({ + val name$3: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$TermName + = dotty.tools.dotc.ast.untpd.cpy().ValDef$default$2(vdef) + val tpt$1: + dotty.tools.dotc.ast.untpd.dotty$tools$dotc$ast$untpd$$TypedSplice + = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2(), ctx).withPos( + vdef.tpt().pos() + ).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + ) + val rhs$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.ast.untpd.cpy().ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy().ValDef(vdef, name$3, tpt$1, rhs$1) + }, sym, ctx) + def typedDefDef( + val ddef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + val restpe: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx).resultType() + val ddef1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + = + { + val name$4: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$TermName + = dotty.tools.dotc.ast.untpd.cpy().DefDef$default$2(ddef) + val vparamss$1: scala.collection.immutable.List = { + val $7$: scala.collection.immutable.List = + ddef.vparamss().flatten($conforms()).asInstanceOf[ + scala.collection.immutable.List + ] + scala.package.Nil().::($7$) + } + val tpt$2: + dotty.tools.dotc.ast.untpd.dotty$tools$dotc$ast$untpd$$TypedSplice + = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2() + , ctx).withPos(ddef.tpt().pos()).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + ) + val rhs$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + { + val selector120: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = ddef.rhs() + { + def case361(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case371(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + ddef.rhs() + } + } + } + if + selector120.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Ident + ] + then { + val x211: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Ident + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + { + val o62: Option = + dotty.tools.dotc.ast.Trees.Ident.unapply( + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + ) + if o62.isDefined() then { + val x39: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = + o62.get().asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + ] + { + val p47: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = x39 + if + dotty.tools.dotc.core.StdNames.nme().WILDCARD().equals + ( + p47) + then { + val x54: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TermName + = + p47.asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TermName + ] + { + val id: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + { + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe, ctx) + ) + } + } + } else case371() + } + } else case371() + } + } else case371() + } + case361() + } + } + dotty.tools.dotc.ast.untpd.cpy().DefDef(ddef, name$4, + scala.package.Nil() + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym, ctx) + } + def typedTypeDef( + val tdef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.tpd.EmptyTree() + def typedStats(val stats: scala.collection.immutable.List, + val exprOwner: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): scala.collection.immutable.List = { + val stats1: scala.collection.immutable.List = + dotty.tools.dotc.ast.Trees.flatten( + super.typedStats(stats, exprOwner, ctx) + ) + if ctx.owner().isClass() then { + val $8$: scala.collection.immutable.List = stats1 + Typer.this.addBridges(stats, stats1, ctx).:::($8$) + } else stats1 + } + def addBridges(val oldStats: scala.collection.immutable.List, + val newStats: scala.collection.immutable.List + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): scala.collection.immutable.List = { + val beforeCtx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase() + ) + Typer.this.traverse$1(ctx, beforeCtx, newStats, oldStats, + traverse$default$3$1() + ) + } + def makeBridgeDef( + val newDef: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + val bridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = + { + val owner$3: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + () + val name$5: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = parentSym.name(ctx) + val flags$1: + dotty.tools.dotc.core.Flags.dotty$tools$dotc$core$Flags$$FlagSet + = + dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).flags(ctx).| + ( + dotty.tools.dotc.core.Flags.Bridge()) + val info$3: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ctx.newSymbol$default$5() + ctx.newSymbol(owner$3, name$5, flags$1, info$3, privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().coord() + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase().prev().asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers. + dotty$tools$dotc$core$DenotTransformers$$DenotTransformer + ] + , ctx) + ctx.debuglog({ + closure(newDef, ctx, bridge | Typer.this.$anonfun$makeBridgeDef$1: + Function0 + ) + }) + val sel: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().asClass() + , ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + termRef + (ctx) + , ctx) + val resultType: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.Symbols.toDenot(bridge, ctx).info(ctx).widen(ctx + ) + .resultType() + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + closure(newDef, parentSym, ctx, sel, resultType | + Typer.this.$anonfun$makeBridgeDef$2 + ) + } + }, ctx) + } + def adapt( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val original: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val printer$1: + dotty.tools.dotc.config.Printers. + dotty$tools$dotc$config$Printers$$Printer + = ctx.traceIndented$default$2() + ctx.traceIndented({ + closure(tree, pt, ctx | Typer.this.$anonfun$adapt$1:Function0) + }, printer$1, true, { + closure(tree, pt, ctx | Typer.this.$anonfun$adapt$2:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + } + def $anonfun$promote$1( + val tree$8: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$12: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val erased$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): String = + StringContext.apply( + Predef.wrapRefArray(["promoting ",": ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree$8.show(ctx$12) + },{ + erased$1.showWithUnderlying( + erased$1.showWithUnderlying$default$1() + , ctx$12) + }] + ): + ) + def $anonfun$typedSelect$1( + val tree$9: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , + val ctx$13: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = tree$9.show(ctx$13) + def select$1( + val tree$10: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , + val ctx$14: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val name: dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = + { + val selector111: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = tree$10.typeOpt() + { + def case201(): + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = { + def case211(): + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = { + { + { + sym.name(ctx$14) + } + } + } + if + selector111.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + ] + then { + val tp: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + = + selector111.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + ] + { + if + dotty.tools.dotc.core.NameOps.NameDecorator(tp.name()). + isInheritedName + () + then { + dotty.tools.dotc.core.NameOps.NameDecorator(sym.name(ctx$14) + ) + .inheritedName() + } else case211() + } + } else case211() + } + case201() + } + } + dotty.tools.dotc.ast.untpd.cpy().Select(tree$10, qual, sym.name(ctx$14) + , + ctx$14).withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ] + , sym, ctx$14) + , ctx$14) + } + def selectArrayMember$1( + val tree$11: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt$3: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$15: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val erasedPre: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel14( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val erasedPre: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx$15).ObjectClass() + , ctx$15) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator(tree$11.name()). + genericArrayOp + () + , pt$3, Predef.wrapRefArray([qual]): , ctx$15) + else + if + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].<:<(erasedPre, ctx$15).unary_!() + then + tailLabel14($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, erasedPre, + ctx$15 + ) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy().Select(tree$11, qual, + dotty.tools.dotc.core.NameOps.NameDecorator(tree$11.name()). + primitiveArrayOp + () + , ctx$15) + , qual, ctx$15) + tailLabel14(Typer.this, qual, erasedPre) + } + def adaptIfSuper$1( + val ctx$16: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + val selector113: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = qual + { + def case231(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case241(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + qual + } + } + } + if + selector113.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + ] + then { + val x28: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + = + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + ] + { + val o61: Option = + dotty.tools.dotc.ast.Trees.Super.unapply( + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Super + ] + ) + if o61.isDefined() then { + val x37: Tuple2 = o61.get().asInstanceOf[Tuple2] + { + val thisQual: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x37._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p46: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + = + x37._2().asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + ] + if + dotty.tools.dotc.core.StdNames.tpnme().EMPTY().equals(p46) + then { + val x53: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + = + p46: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + { + { + val $4$: Tuple2 = { + val selector112: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ]: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + { + def case221(): Tuple2 = { + def matchFail121(): Tuple2 = + throw new MatchError(selector112) + if + selector112.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + then { + val x27: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + = + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + { + val o42: Option = + dotty.tools.dotc.core.Types.SuperType. + unapply + ( + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + ) + if o42.isDefined() then { + val x36: Tuple2 = + o42.get().asInstanceOf[Tuple2] + { + val thisType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x36._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val supType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x36._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + Tuple2.apply(thisType, supType) + } + } + } else matchFail121() + } + } else matchFail121() + } + case221() + } + } + val thisType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $4$._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val supType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $4$._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$1, + ctx$16 + ).owner() + , ctx$16).is(dotty.tools.dotc.core.Flags.Trait(), + ctx$16 + ) + then + dotty.tools.dotc.ast.tpd.cpy().Super(qual, thisQual + , + dotty.tools.dotc.core.Symbols.toDenot(sym$1, ctx$16) + . + owner().asClass().name(ctx$16).asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + ] + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$1, + ctx$16 + ).owner() + , ctx$16).typeRef(ctx$16) + , ctx$16) + , ctx$16) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , thisType.firstParent(ctx$16), ctx$16) + , ctx$16) + } + } + } else case241() + } + } else case241() + } + } else case241() + } + case231() + } + } + def $anonfun$9( + val ctx$18: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply(Predef.wrapRefArray(["",""]): ).s( + Predef.wrapRefArray( + [{ + sym$3.showLocated(ctx$18) + }] + ): + ) + def recur$1( + val tree$12: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt$4: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$17: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def tailLabel16( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree) + : + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$17) + ).isPrimitiveValueType(ctx$17) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner() + , ctx$17).isPrimitiveValueClass(ctx$17) + if + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx$17).AnyClass() + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx$17).AnyValClass() + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).isConstructor + ( + ) + , { + closure(ctx$17, sym$2 | Typer.this.$anonfun$9:Function0) + }) + Typer.this.select$1(tree$12, ctx$17, qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx$17).ObjectClass() + , ctx$17).info(ctx$17).decl(sym$2.name(ctx$17), ctx$17).symbol() + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!()).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + ).isErasedValueType(ctx$17) + ) + then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, { + closure($anonfun$17:Function0) + }, ctx$17) + ) + else + if qualIsPrimitive.unary_!().&&(symIsPrimitive) then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner + ( + ) + , ctx$17).typeRef(ctx$17) + , ctx$17) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner(). + eq + (dotty.tools.dotc.core.Symbols.defn(ctx$17).ArrayClass()) + then + Typer.this.selectArrayMember$1(tree$12, pt$4, ctx$17, qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree$12.qualifier().typeOpt().widen(ctx$17). + finalResultType + () + , ctx$17) + ) + else { + val qual1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = Typer.this.adaptIfSuper$1(ctx$17, sym$2, qual) + if + qual1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner + ( + ) + , ctx$17).||( + qual1.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Super + ] + ) + then Typer.this.select$1(tree$12, ctx$17, qual1, sym$2) else + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17). + owner + () + , ctx$17).typeRef(ctx$17) + , ctx$17) + ) + } + } + tailLabel16(Typer.this, qual) + } + def $anonfun$typedThis$1( + val tree$13: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + , + val ctx$19: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["computing outer path from ","%, % to ",", encl class = ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx$19.owner(), ctx$19). + ownersIterator + (ctx$19).toList() + },{ + tree$13.symbol(ctx$19) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx$19.owner(), ctx$19). + enclosingClass + (ctx$19) + }] + ): + , ctx$19) + def $anonfun$7( + val ctx$20: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.typedExpr(tree, pt, ctx$20) + def $anonfun$12( + val ctx$21: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , _$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = Typer.this.typedType(_$1, Typer.this.typedType$default$2(), ctx$21) + def $anonfun$15( + val ctx$22: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.typedExpr(tree, pt, ctx$22) + def $anonfun$6( + val ctx$24: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$2: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val oldSymbol$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newSymbol$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply( + Predef.wrapRefArray([""," bridging with ",""]): + ).s( + Predef.wrapRefArray( + [{ + oldSymbol$1.name(beforeCtx$2) + },{ + newSymbol$1.name(ctx$24) + }] + ): + ) + def stillInBaseClass$1( + val ctx$25: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(ctx$25.owner(), ctx$25). + derivesFrom + (dotty.tools.dotc.core.Symbols.toDenot(sym, ctx$25).owner(), ctx$25) + def $anonfun$16( + val ctx$43: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = Typer.this.stillInBaseClass$1(ctx$43, sym) + def $anonfun$20( + val ctx$27: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + nxtBridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(bridge$1, ctx$27).info(ctx$27).=:= + ( + dotty.tools.dotc.core.Symbols.toDenot(nxtBridge, ctx$27).info(ctx$27), + ctx$27 + ).unary_!() + def $anonfun$8( + val ctx$28: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : Boolean = { + sym.name(ctx$28).eq(bridge$2.name(ctx$28)).&&( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx$28).info(ctx$28).widen( + ctx$28 + ).=:=( + dotty.tools.dotc.core.Symbols.toDenot(bridge$2, ctx$28).info(ctx$28) + . + widen(ctx$28) + , ctx$28) + ) + } + def $anonfun$$anonfun$19$1( + val ctx$30: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$4: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val stat: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef) + : + Boolean = + stat.name().==(bridge$4.name(ctx$30)).&&( + stat.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$30).=:=( + dotty.tools.dotc.core.Symbols.toDenot(bridge$4, ctx$30).info(ctx$30) + . + widen(ctx$30) + , ctx$30) + ) + def $anonfun$$anonfun$2( + val ctx$31: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val _$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef) + : + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + _$2.symbol(ctx$31) + def $anonfun$19( + val ctx$29: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val emittedBridges$2: scala.collection.mutable.ListBuffer, + val bridge$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Option = + emittedBridges$2.find({ + closure(ctx$29, bridge$3 | Typer.this.$anonfun$$anonfun$19$1) + }).map({ + closure(ctx$29 | Typer.this.$anonfun$$anonfun$2) + }) + def $anonfun$14( + val ctx$32: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$4: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val newSymbol$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val bridge$5: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val cl$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["bridge for method "," of type ","\\n"]): + + ) + ).i( + Predef.wrapRefArray( + [{ + newSymbol$3.showLocated(beforeCtx$4) + },{ + dotty.tools.dotc.core.Symbols.toDenot(newSymbol$3, ctx$32).info( + beforeCtx$4 + ) + }] + ): + , ctx$32).+( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["clashes with "," of type ","\\n"]): + + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(cl$1, ctx$32).symbol(). + showLocated + (beforeCtx$4) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(cl$1, ctx$32).symbol() + , ctx$32).info(beforeCtx$4) + }] + ): + , ctx$32) + ).+( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["both have same type after erasure: ",""]): + + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(bridge$5, ctx$32).symbol + ( + ) + , ctx$32).info(ctx$32) + }] + ): + , ctx$32) + ) + def $anonfun$3( + val ctx$26: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$3: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val emittedBridges$1: scala.collection.mutable.ListBuffer, + val oldSymbol$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newSymbol$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val minimalSet$1: scala.runtime.ObjectRef, + val bridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Unit = { + val isRequired: Boolean = + minimalSet$1.elem.asInstanceOf[scala.collection.immutable.Set].forall( + { + closure(ctx$26, bridge | Typer.this.$anonfun$20) + }) + if isRequired then { + val clash: Option = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(oldSymbol$2, ctx$26).owner() + , ctx$26).decls(ctx$26).lookupAll(bridge.name(ctx$26), ctx$26).find( + { + { + closure(ctx$26, bridge | Typer.this.$anonfun$8) + } + }).orElse({ + closure(ctx$26, emittedBridges$1, bridge | Typer.this.$anonfun$19: + Function0 + ) + }) + { + val selector121: Option = clash + { + def case381(): Unit = { + def case391(): Unit = { + def matchFail211(): Unit = throw new MatchError(selector121) + if None.equals(selector121) then { + val x41: None$ = selector121.asInstanceOf[None$] + { + { + minimalSet$1.elem = + minimalSet$1.elem.asInstanceOf[ + scala.collection.immutable.Set + ].+(bridge).asInstanceOf[ + scala.collection.immutable.Set + ] + } + } + } else matchFail211() + } + if selector121.isInstanceOf[Some] then { + val x212: Some = selector121.asInstanceOf[Some] + { + val o53: Option = + Some.unapply(selector121.asInstanceOf[Some]) + if o53.isDefined() then { + val x310: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + o53.get().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + ] + { + val cl: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = x310 + { + { + ctx$26.error({ + closure(ctx$26, beforeCtx$3, newSymbol$2, bridge, + cl + | Typer.this.$anonfun$14:Function0) + }, ctx$26.error$default$2()) + } + } + } + } else case391() + } + } else case391() + } + case381() + } + } + } else () + } + def $anonfun$18( + val ctx$33: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val $this$1: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , + val member$1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + $this$1.makeBridgeDef(member$1, sym, ctx$33) + } + def traverse$1( + val ctx$23: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$1: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + def tailLabel30( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + { + val selector123: scala.collection.immutable.List = after + { + def case431(): scala.collection.immutable.List = { + def case441(): scala.collection.immutable.List = { + def case451(): scala.collection.immutable.List = { + def matchFail231(): scala.collection.immutable.List = + throw new MatchError(selector123) + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x65: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.::] + { + val o82: Option = + scala.package.::().unapply( + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o82.isDefined() then { + val x73: Tuple2 = o82.get().asInstanceOf[Tuple2] + { + val newTail: scala.collection.immutable.List = + x73._2().asInstanceOf[ + scala.collection.immutable.List + ] + { + { + tailLabel30($this, newTail, before, + traverse$default$3$1() + ) + } + } + } + } else matchFail231() + } + } else matchFail231() + } + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x312: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.::] + { + val o94: Option = + scala.package.::().unapply( + selector123.asInstanceOf[scala.collection.immutable.:: + ] + ) + if o94.isDefined() then { + val x43: Tuple2 = o94.get().asInstanceOf[Tuple2] + { + val pi52: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x43._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val newTail: scala.collection.immutable.List = + x43._2().asInstanceOf[ + scala.collection.immutable.List + ] + if + pi52.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + then { + val member: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + = + pi52.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + { + { + { + val selector122: + scala.collection.immutable.List + = before + { + def case401(): + scala.collection.immutable.List + = { + def case411(): + scala.collection.immutable.List + = { + def case421(): + scala.collection.immutable.List + = { + def matchFail221(): + scala.collection.immutable.List + = throw new MatchError(selector122) + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x64: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o81: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable. + :: + ] + ) + if o81.isDefined() then { + val x72: Tuple2 = + o81.get().asInstanceOf[Tuple2] + { + val oldTail: + scala.collection.immutable. + List + = + x72._2().asInstanceOf[ + scala.collection.immutable + . + List + ] + { + { + tailLabel30($this, after, + oldTail + , traverse$default$3$1()) + } + } + } + } else matchFail221() + } + } else matchFail221() + } + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x311: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o93: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o93.isDefined() then { + val x42: Tuple2 = + o93.get().asInstanceOf[Tuple2] + { + val pi51: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x42._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val oldTail: + scala.collection.immutable. + List + = + x42._2().asInstanceOf[ + scala.collection.immutable. + List + ] + if + pi51.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + then { + val oldMember: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + = + pi51.asInstanceOf[ + dotty.tools.dotc.ast.Trees + . + dotty$tools$dotc$ast$Trees$$DefDef + ] + { + { + val oldSymbol: + dotty.tools.dotc.core.Symbols + . + dotty$tools$dotc$core$Symbols$$Symbol + = + oldMember.symbol( + beforeCtx$1 + ) + val newSymbol: + dotty.tools.dotc.core.Symbols + . + dotty$tools$dotc$core$Symbols$$Symbol + = member.symbol(ctx$23) + assert( + oldSymbol.name( + beforeCtx$1 + ).==( + newSymbol.name(ctx$23) + ) + , { + closure(ctx$23, + beforeCtx$1 + , oldSymbol, newSymbol + | + Typer.this.$anonfun$6: + Function0 + ) + }) + val newOverridden: + scala.collection.immutable + . + Set + = + oldSymbol.denot(ctx$23). + allOverriddenSymbols + (ctx$23).toSet() + val oldOverridden: + scala.collection.immutable + . + Set + = + dotty.tools.dotc.core. + Symbols + .toDenot(newSymbol, + ctx$23 + ).allOverriddenSymbols( + beforeCtx$1 + ).toSet() + val neededBridges: + scala.collection.immutable + . + Set + = + oldOverridden.--( + newOverridden + ).asInstanceOf[ + scala.collection. + TraversableLike + ].filter({ + closure(ctx$23 | + Typer.this. + $anonfun$16 + ) + }).asInstanceOf[ + scala.collection.immutable + . + Set + ] + val minimalSet: + scala.runtime.ObjectRef + = + scala.runtime.ObjectRef$ + # + create( + Set().apply( + Predef. + genericWrapArray + ([]): + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + ) + neededBridges.foreach({ + closure(ctx$23, + beforeCtx$1 + , emittedBridges, + oldSymbol + , newSymbol, minimalSet + | + Typer.this.$anonfun$3) + }) + val bridgeImplementations + : + scala.collection.immutable + . + Set + = + minimalSet.elem. + asInstanceOf + [ + scala.collection.immutable + . + Set + ].map({ + { + closure(ctx$23, + $this + , member | + Typer.this. + $anonfun$18 + ) + } + }, + scala.collection.immutable + . + Set.canBuildFrom() + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + emittedBridges.++=( + bridgeImplementations + ) + tailLabel30($this, newTail + , + oldTail, + traverse$default$3$1() + ) + } + } + } else case421() + } + } else case421() + } + } else case421() + } + if scala.package.Nil().equals(selector122) + then + { + val x213: + scala.collection.immutable.Nil$ + = + selector122.asInstanceOf[ + scala.collection.immutable.Nil$ + ] + { + { + emittedBridges.toList() + } + } + } else case411() + } + case401() + } + } + } + } + } else case451() + } + } else case451() + } + } else case451() + } + if scala.package.Nil().equals(selector123) then { + val x214: scala.collection.immutable.Nil$ = + selector123.asInstanceOf[scala.collection.immutable.Nil$] + { + { + emittedBridges.toList() + } + } + } else case441() + } + case431() + } + } + } + tailLabel30(Typer.this, after, before, emittedBridges) + } + def $anonfun$error$1( + val newDef$2: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$35: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val reason$1: String): String = + StringContext.apply( + Predef.wrapRefArray( + ["failure creating bridge from "," to ",", reason: ",""] + ): + ).s( + Predef.wrapRefArray( + [{ + newDef$2.symbol(ctx$35) + },{ + parentSym$2 + },reason$1] + ): + ) + def error$1( + val newDef$1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$34: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val reason: String): Nothing = { + assert(false, { + closure(newDef$1, parentSym$1, ctx$34, reason | + Typer.this.$anonfun$error$1 + :Function0) + }) + ???() + } + def $anonfun$makeBridgeDef$1( + val newDef$3: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val ctx$36: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$6: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply( + Predef.wrapRefArray(["generating bridge from "," to ",""]): + ).s( + Predef.wrapRefArray( + [{ + newDef$3.symbol(ctx$36) + },bridge$6] + ): + ) + def $anonfun$$anonfun$1( + val ctx$39: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , _$3: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + _$4: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.adapt(_$3, _$4, dotty.tools.dotc.ast.untpd.EmptyTree(), + ctx$39 + ) + def $anonfun$21( + val newDef$5: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$4: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$38: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , fun: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + vparams: scala.collection.immutable.List + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val selector124: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + fun.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$38) + { + def case461(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def case471(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + { + val a: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = selector124 + { + Typer.this.error$1(newDef$5, parentSym$4, ctx$38, + StringContext.apply( + Predef.wrapRefArray(["can not resolve apply type ",""]): + + ).s(Predef.wrapRefArray([a]): ) + ) + } + } + } + if + selector124.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val x215: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + val o44: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + ) + if o44.isDefined() then { + val x313: Tuple2 = o44.get().asInstanceOf[Tuple2] + { + val types: scala.collection.immutable.List = + x313._2().asInstanceOf[scala.collection.immutable.List] + { + { + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps(Tuple2.apply(vparams, types)).zipped + ( + $conforms(), $conforms()).map({ + closure(ctx$38 | Typer.this.$anonfun$$anonfun$1) + }, scala.collection.immutable.List.canBuildFrom()). + asInstanceOf + [scala.collection.immutable.List] + , ctx$38) + } + } + } + } else case471() + } + } else case471() + } + case461() + } + } + def $anonfun$makeBridgeDef$2( + val newDef$4: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$37: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val sel$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val resultType$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val paramss: scala.collection.immutable.List): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + val rhs: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + paramss.foldLeft(sel$1, { + closure(newDef$4, parentSym$3, ctx$37 | Typer.this.$anonfun$21) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + Typer.this.adapt(rhs, resultType$1, Typer.this.adapt$default$3(), ctx$37 + ) + } + def $anonfun$adapt$1( + val tree$14: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$5: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$40: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["adapting ",": "," to ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$14.showSummary(ctx$40) + },{ + tree$14.tpe() + },pt$5] + ): + , ctx$40) + def $anonfun$$anonfun$adapt$2$1( + val ctx$42: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Phases.dotty$tools$dotc$core$Phases$$Phase = + ctx$42.phase() + def $anonfun$adapt$2( + val tree$15: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$6: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$41: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + assert( + ctx$41.phase().==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx$41).erasurePhase() + . + next() + ) + , { + closure(ctx$41 | Typer.this.$anonfun$$anonfun$adapt$2$1:Function0) + }) + if tree$15.isEmpty() then tree$15 else + if ctx$41.mode().is(dotty.tools.dotc.typer.Mode.Pattern()) then + tree$15 + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree$15, pt$6 + , + ctx$41) + } + } + class Typer$ extends Object { + this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + => + + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + = { + Typer$.super() + () + } + } + } +} +result of ./src/dotty/tools/dotc/transform/Erasure.scala after genBCode: +package dotty.tools.dotc { + package dotty.tools.dotc.transform { + class Erasure extends dotty.tools.dotc.util.DotClass with + dotty.tools.dotc.core.Phases + .dotty$tools$dotc$core$Phases$$Phase with + dotty.tools.dotc.core.DenotTransformers + .dotty$tools$dotc$core$DenotTransformers$$DenotTransformer { + thisTransformer: dotty.tools.dotc.transform.Erasure => + + def (): dotty.tools.dotc.transform.Erasure = { + Erasure.super() + Erasure.super[Phase]() + Erasure.super[DenotTransformer]() + Erasure.this.eraser$$local = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + () + () + } + def myPeriod(): + dotty.tools.dotc.core.Periods.dotty$tools$dotc$core$Periods$$Period + = Erasure.super[Phase].initial$myPeriod() + def myBase(): + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$ContextBase + = Erasure.super[Phase].initial$myBase() + def myErasedTypes(): Boolean = + Erasure.super[Phase].initial$myErasedTypes() + def myFlatClasses(): Boolean = + Erasure.super[Phase].initial$myFlatClasses() + def myRefChecked(): Boolean = Erasure.super[Phase].initial$myRefChecked() + def mySymbolicRefs(): Boolean = + Erasure.super[Phase].initial$mySymbolicRefs() + def myPeriod_=( + val x$1: + dotty.tools.dotc.core.Periods.dotty$tools$dotc$core$Periods$$Period + ): Unit = () + def myBase_=( + val x$1: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$ContextBase + ): Unit = () + def myErasedTypes_=(val x$1: Boolean): Unit = () + def myFlatClasses_=(val x$1: Boolean): Unit = () + def myRefChecked_=(val x$1: Boolean): Unit = () + def mySymbolicRefs_=(val x$1: Boolean): Unit = () + def toString(): String = Erasure.super[Phase].toString() + def phaseName(): String = "erasure" + def runsAfter(): scala.collection.immutable.Set = + Set().apply( + Predef.wrapRefArray([classOf(),classOf(),classOf()]): + ).asInstanceOf[scala.collection.immutable.Set] + def transform( + val ref: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + val selector12: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = ref + { + def case21(): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + def case31(): + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = { + { + val ref: + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$SingleDenotation + = selector12 + { + ref.derivedSingleDenotation(ref.symbol(), + dotty.tools.dotc.core.TypeErasure.eraseInfo(ref.info(ctx), + ctx + ) + , ctx) + } + } + } + if + selector12.isInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ] + then { + val ref: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + = + selector12.asInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ] + { + { + assert(ctx.phase().==(this), { + closure(ctx, ref | Erasure.this.$anonfun$13:Function0) + }) + if + ref.symbol().eq( + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + ) + then { + val $1$: Tuple4 = { + val selector11: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + ref.info(ctx): + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + { + def case11(): Tuple4 = { + def matchFail11(): Tuple4 = + throw new MatchError(selector11) + if + selector11.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + then { + val x21: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + = + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + { + val o51: Option = + dotty.tools.dotc.core.Types.ClassInfo.unapply( + selector11.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ClassInfo + ] + ) + if o51.isDefined() then { + val x31: Tuple5 = o51.get().asInstanceOf[Tuple5] + { + val pre: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x31._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val ps: scala.collection.immutable.List = + x31._3().asInstanceOf[ + scala.collection.immutable.List + ] + val decls: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + = + x31._4().asInstanceOf[ + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass + = + x31._5().asInstanceOf[ + dotty.tools.dotc.util.DotClass + ] + { + val p41: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x31._2().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + Tuple4.apply(pre, ps, decls, selfInfo) + } + } + } else matchFail11() + } + } else matchFail11() + } + case11() + } + } + val pre: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $1$._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val ps: scala.collection.immutable.List = + $1$._2().asInstanceOf[scala.collection.immutable.List] + val decls: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + = + $1$._3().asInstanceOf[ + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$Scope + ] + val selfInfo: dotty.tools.dotc.util.DotClass = + $1$._4().asInstanceOf[dotty.tools.dotc.util.DotClass] + val extendedScope: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$MutableScope + = decls.cloneScope(ctx) + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + , ctx).classInfo(ctx).decls().foreach({ + closure(ctx, extendedScope | + Erasure.this.$anonfun$transform$1 + ) + }) + { + val symbol$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$1() + val owner$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$2() + val name$1: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = ref.copySymDenotation$default$3() + val initFlags$1: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = ref.copySymDenotation$default$4() + val info$1: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , + dotty.tools.dotc.core.Types.ClassInfo.apply(pre, + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass( + ) + , ps, extendedScope, selfInfo, ctx) + , ctx) + val privateWithin$1: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$6() + val annotations$1: scala.collection.immutable.List = + ref.copySymDenotation$default$7() + ref.copySymDenotation(symbol$1, owner$1, name$1, + initFlags$1 + , info$1, privateWithin$1, annotations$1, ctx) + } + } else { + val oldOwner: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.owner() + val newOwner: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + if + oldOwner.eq( + dotty.tools.dotc.core.Symbols.defn(ctx).AnyClass() + ) + then + dotty.tools.dotc.core.Symbols.defn(ctx).ObjectClass() + else oldOwner + val oldInfo: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = ref.info(ctx) + val newInfo: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.TypeErasure.transformInfo( + ref.symbol() + , oldInfo, ctx) + val oldFlags: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = ref.flags(ctx) + val newFlags: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = + ref.flags(ctx).&~( + dotty.tools.dotc.core.Flags.HasDefaultParams() + ) + if + oldOwner.eq(newOwner).&&(oldInfo.eq(newInfo)).&&( + oldFlags.==(newFlags) + ) + then ref else { + assert( + ref.is(dotty.tools.dotc.core.Flags.PackageClass(), ctx). + unary_! + () + , { + closure(ctx, ref, oldOwner, newOwner, oldInfo, newInfo + | + Erasure.this.$anonfun$2:Function0) + }) + { + val symbol$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ref.copySymDenotation$default$1() + val owner$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = newOwner + val name$2: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = ref.copySymDenotation$default$3() + val initFlags$2: + dotty.tools.dotc.core.Flags. + dotty$tools$dotc$core$Flags$$FlagSet + = newFlags + val info$2: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = newInfo + ref.copySymDenotation(symbol$2, owner$2, name$2, + initFlags$2 + , info$2, ref.copySymDenotation$default$6(), + ref.copySymDenotation$default$7() + , ctx) + } + } + } + } + } + } else case31() + } + case21() + } + } + val eraser$$local: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + def eraser(): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + = Erasure.this.eraser$$local + def run( + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + val unit: dotty.tools.dotc.CompilationUnit = ctx.compilationUnit() + unit.tpdTree_=( + Erasure.this.eraser().typedExpr(unit.tpdTree(), + Erasure.this.eraser().typedExpr$default$2() + , ctx.fresh().setPhase(this.next())) + ) + } + def checkPostCondition( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + Erasure.this.assertErased(tree, ctx) + { + val selector13: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = tree + { + def case41(): Unit = { + def case51(): Unit = { + { + { + () + } + } + } + if + selector13.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + ] + then { + val res: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + = + selector13.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + ] + { + { + assert( + dotty.tools.dotc.transform.ExplicitOuter.referencesOuter( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + , res, ctx).unary_!() + , { + closure(ctx, res | Erasure.this.$anonfun$1:Function0) + }) + } + } + } else case51() + } + case41() + } + } + } + def assertErased( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = { + Erasure.this.assertErased(tree.typeOpt(), tree, ctx) + if + dotty.tools.dotc.core.Symbols.defn(ctx).isPolymorphicAfterErasure(). + apply + (tree.symbol(ctx)).unary_!() + then Erasure.this.assertErased(tree.typeOpt().widen(ctx), tree, ctx) + else + () + if ctx.mode().isExpr() then { + val selector14: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ] + { + def case61(): Unit = { + def case71(): Unit = { + { + { + () + } + } + } + if + selector14.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + then { + val ref: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + = + selector14.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + { + { + assert( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ].||( + ref.denot(ctx).isInstanceOf[ + dotty.tools.dotc.core.Denotations. + dotty$tools$dotc$core$Denotations$$UniqueRefDenotation + ] + ) + , { + closure(tree, ctx, ref | Erasure.this.$anonfun$5:Function0 + ) + }) + } + } + } else case71() + } + case61() + } + } else () + } + def assertErased( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = + assert(dotty.tools.dotc.core.TypeErasure.isErasedType(tp, ctx), { + closure(tp, tree, ctx | Erasure.this.$anonfun$assertErased$1:Function0 + ) + }) + def assertErased$default$2(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Thicket + = dotty.tools.dotc.ast.tpd.EmptyTree() + def $anonfun$13( + val ctx$1: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$1: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + ): String = + StringContext.apply( + Predef.wrapRefArray(["transforming "," at ",""]): + ).s( + Predef.wrapRefArray( + [ref$1,{ + ctx$1.phase().asInstanceOf[dotty.tools.dotc.util.DotClass] + }] + ): + ) + def $anonfun$transform$1( + val ctx$2: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val extendedScope$1: + dotty.tools.dotc.core.Scopes. + dotty$tools$dotc$core$Scopes$$MutableScope + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + extendedScope$1.enter(sym, ctx$2) + def $anonfun$2( + val ctx$3: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$2: + dotty.tools.dotc.core.SymDenotations. + dotty$tools$dotc$core$SymDenotations$$SymDenotation + , + val oldOwner$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newOwner$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val oldInfo$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val newInfo$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): String = + StringContext.apply( + Predef.wrapRefArray( + ["trans "," @ "," oldOwner = ",", newOwner = ",", oldInfo = ", + ", newInfo = " + ," "," ",""] + ): + ).s( + Predef.genericWrapArray( + [ref$2,{ + ctx$3.phase() + },oldOwner$1,newOwner$1,oldInfo$1,newInfo$1,{ + scala.Boolean.box(oldOwner$1.eq(newOwner$1)) + },{ + scala.Boolean.box(oldInfo$1.eq(newInfo$1)) + }] + ): + ) + def $anonfun$1( + val ctx$4: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val res$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This) + : + String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["Reference to "," from ",""]): + ) + ).i( + Predef.wrapRefArray( + [res$1,{ + ctx$4.owner().showLocated(ctx$4) + }] + ): + , ctx$4) + def $anonfun$5( + val tree$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$5: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val ref$3: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["non-sym type "," of class "," with denot of class "," of ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [ref$3,{ + ref$3.getClass() + },{ + ref$3.denot(ctx$5).getClass() + },tree$1] + ): + , ctx$5) + def $anonfun$assertErased$1( + val tp$1: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val tree$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$6: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["The type "," - "," of class "," of tree "," : "," / ", + " is illegal after erasure, phase = " + ,""] + ): + ) + ).i( + Predef.wrapRefArray( + [tp$1,{ + tp$1.toString() + },{ + tp$1.getClass() + },tree$2,{ + tree$2.tpe() + },{ + tree$2.getClass() + },{ + ctx$6.phase() + }] + ): + , ctx$6) + } + val Erasure: dotty.tools.dotc.transform.Erasure$ = + new dotty.tools.dotc.transform.Erasure$() + class Erasure$ extends Object with dotty.tools.dotc.transform.TypeTestsCasts + + { this: => + def (): dotty.tools.dotc.transform.Erasure$ = { + Erasure$.super() + Erasure$.super[TypeTestsCasts]() + () + } + val Boxing: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + () + val Typer: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + = + new + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + () + def $anonfun$10(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def $anonfun$4(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def $anonfun$17(): String = + dotty.tools.dotc.transform.Erasure.Boxing.box$default$2() + def traverse$default$3$1(): scala.collection.mutable.ListBuffer = + collection.mutable.ListBuffer.apply( + Predef.genericWrapArray([]): + ).asInstanceOf[scala.collection.mutable.ListBuffer] + } + class Boxing$ extends Object { this: => + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + = { + Boxing$.super() + () + } + def isUnbox( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().unbox()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaBoxedClasses().contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def isBox( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Boolean = + sym.name(ctx).==(dotty.tools.dotc.core.StdNames.nme().box()).&&( + dotty.tools.dotc.core.Symbols.defn(ctx).ScalaValueClasses().contains( + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).owner() + , ctx).linkedClass(ctx) + ) + ) + def boxMethod( + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().box(), ctx) + . + symbol() + def unboxMethod( + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toClassDenot(cls, ctx).linkedClass(ctx) + , ctx).info(ctx).member(dotty.tools.dotc.core.StdNames.nme().unbox(), + ctx + ).symbol() + def safelyRemovableUnboxArg( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val selector15: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = tree + { + def case81(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case91(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + dotty.tools.dotc.ast.tpd.EmptyTree() + } + } + } + if + selector15.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + then { + val x22: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + { + val o101: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply( + selector15.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + ] + ) + if o101.isDefined() then { + val x32: Tuple2 = o101.get().asInstanceOf[Tuple2] + { + val fn: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x32._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p42: scala.collection.immutable.List = + x32._2().asInstanceOf[scala.collection.immutable.List] + if p42.isInstanceOf[scala.collection.immutable.::] then { + val x51: scala.collection.immutable.:: = + p42.asInstanceOf[scala.collection.immutable.::] + { + val o91: Option = + scala.package.::().unapply( + p42.asInstanceOf[scala.collection.immutable.::] + ) + if o91.isDefined() then { + val x61: Tuple2 = o91.get().asInstanceOf[Tuple2] + { + val arg: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x61._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p71: scala.collection.immutable.List = + x61._2().asInstanceOf[ + scala.collection.immutable.List + ] + if scala.package.Nil().equals(p71) then { + val x81: scala.collection.immutable.Nil$ = + p71.asInstanceOf[scala.collection.immutable.Nil$ + ] + { + if + dotty.tools.dotc.transform.Erasure.Boxing. + isUnbox + (fn.symbol(ctx), ctx).&&( + dotty.tools.dotc.core.Symbols.defn(ctx). + ScalaBoxedClasses + ().contains( + arg.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx).typeSymbol(ctx) + ) + ) + then { + arg + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + } else case91() + } + case81() + } + } + def constant( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val const: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if dotty.tools.dotc.ast.tpd.isPureExpr(tree, ctx) then const else + dotty.tools.dotc.ast.tpd.Block({ + val $2$: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + tree + scala.package.Nil().::($2$) + }, const, ctx) + def box( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val target: Function0, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + ctx.traceIndented({ + closure(tree, target, ctx | $anonfun$box$2:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + closure(tree, ctx | $anonfun$box$1:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + def box$default$2(): String = "" + def unbox( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + ctx.traceIndented({ + closure(tree, pt, ctx | $anonfun$unbox$1:Function0) + }, ctx.traceIndented$default$2(), ctx.traceIndented$default$3(), { + closure(tree, pt, ctx | $anonfun$unbox$2:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + def cast( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel11( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + if pt.isRef(dotty.tools.dotc.core.Symbols.defn(ctx).UnitClass(), ctx) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox(tree, pt, ctx) else { + val selector18: Tuple2 = Tuple2.apply(tree.tpe(), pt) + { + def case141(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case151(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + pt + ).isPrimitiveValueType(ctx) + then + dotty.tools.dotc.ast.tpd.primitiveConversion(tree, + pt.classSymbol(ctx) + , ctx) + else + dotty.tools.dotc.ast.tpd.TreeOps(tree).asInstance(pt, + ctx + ) + } + } + } + { + val o111: Option = Tuple2.unapply(selector18) + if o111.isDefined() then { + val x25: Tuple2 = o111.get().asInstanceOf[Tuple2] + { + val p31: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x25._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val p44: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x25._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + if + p31.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + then { + val x52: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + = + p31.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + { + val o102: Option = + dotty.tools.dotc.core.Types.JavaArrayType.unapply( + p31.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + ) + if o102.isDefined() then { + val x62: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + o102.get().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + val treeElem: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = x62 + if + p44.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + then { + val x71: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + = + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + { + val o92: Option = + dotty.tools.dotc.core.Types.JavaArrayType. + unapply + ( + p44.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$JavaArrayType + ] + ) + if o92.isDefined() then { + val x82: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + o92.get().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + val ptElem: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = x82 + { + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (treeElem.widen(ctx)). + isPrimitiveValueType + (ctx).&&( + dotty.tools.dotc.transform.TypeUtils + . + decorateTypeUtils(ptElem). + isPrimitiveValueType + (ctx).unary_!() + ) + then { + tailLabel11($this, + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols. + defn + (ctx).runtimeMethod( + dotty.tools.dotc.core.StdNames + . + nme().toObjectArray() + ) + , ctx) + ).appliedTo(tree, ctx) + , pt, ctx) + } else case151() + } + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } else case151() + } + } + case141() + } + } + } + tailLabel11(Boxing$.this, tree, pt, ctx) + } + def adaptToType( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel12( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Boxing$ + , val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts. + dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + pt.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + then tree else { + val selector19: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case161(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case171(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + val tpw: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = selector19 + { + if + pt.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$ProtoType + ].||( + tree.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].<:<(pt, ctx) + ) + then tree else + if + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils + ( + tpw).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(tree, + { + closure($anonfun$10:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isErasedValueType(ctx) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree + , pt, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing.box( + tree + , { + closure($anonfun$4:Function0) + }, ctx) + , pt, ctx) + else + if + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (pt).isPrimitiveValueType(ctx).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (tpw).isPrimitiveValueType(ctx).unary_!() + ) + then + tailLabel12($this, + dotty.tools.dotc.transform.Erasure.Boxing. + unbox + (tree, pt, ctx) + , pt, ctx) + else + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree + , pt, ctx) + } + } + } + if + selector19.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val x26: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + val o71: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector19.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + ) + if o71.isDefined() then { + val x35: Tuple2 = o71.get().asInstanceOf[Tuple2] + { + val p45: scala.collection.immutable.List = + x35._1().asInstanceOf[scala.collection.immutable.List] + if scala.package.Nil().equals(p45) then { + val x63: scala.collection.immutable.Nil$ = + p45.asInstanceOf[scala.collection.immutable.Nil$] + { + val p51: scala.collection.immutable.List = + x35._2().asInstanceOf[ + scala.collection.immutable.List + ] + if tree.isTerm() then { + tailLabel12($this, + dotty.tools.dotc.ast.tpd.TreeOps(tree). + appliedToNone + (ctx) + , pt, ctx) + } else case171() + } + } else case171() + } + } else case171() + } + } else case171() + } + case161() + } + } + tailLabel12(Boxing$.this, tree, pt, ctx) + } + def $anonfun$box$2( + val tree$3: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val target$1: Function0, + val ctx$7: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["boxing ",": "," into ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$3.showSummary(ctx$7) + },{ + tree$3.tpe() + },target$1.apply()] + ): + , ctx$7) + def $anonfun$11( + val tree$5: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$9: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val arg$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree) + : + String = + StringContext.apply( + Predef.wrapRefArray(["boxing an unbox: "," -> ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree$5.symbol(ctx$9) + },{ + arg$1.tpe().asInstanceOf[dotty.tools.dotc.util.DotClass] + }] + ): + ) + def $anonfun$box$1( + val tree$4: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$8: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + { + val selector16: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + tree$4.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$8) + { + def case101(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case111(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + val tp: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = selector16 + { + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = tp.classSymbol(ctx$8) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$8).UnitClass() + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree$4 + , + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx$8).BoxedUnit_UNIT + ( + ) + , ctx$8) + , ctx$8) + else + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$8).NothingClass + ( + ) + ) + then tree$4 else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx$8).ArrayClass + ( + ) + ) + ) + val arg: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.Boxing. + safelyRemovableUnboxArg + (tree$4, ctx$8) + if arg.isEmpty() then + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing. + boxMethod + (cls.asClass(), ctx$8) + , ctx$8) + ).appliedTo(tree$4, ctx$8) + else { + ctx$8.log({ + closure(tree$4, ctx$8, arg | $anonfun$11:Function0) + }) + arg + } + } + } + } + } + if + selector16.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + then { + val x23: + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + = + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + { + val o52: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType.unapply( + selector16.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + ) + if o52.isDefined() then { + val x33: Tuple2 = o52.get().asInstanceOf[Tuple2] + { + val clazz: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x33._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + { + val p43: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x33._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + dotty.tools.dotc.ast.tpd.New( + dotty.tools.dotc.core.Symbols.toClassDenot(clazz, + ctx$8 + ).typeRef(ctx$8) + , { + val $3$: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.Boxing.cast( + tree$4 + , + dotty.tools.dotc.transform.ValueClasses. + underlyingOfValueClass + ( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$8) + , ctx$8) + , ctx$8) + scala.package.Nil().::($3$) + }, ctx$8) + } + } + } + } else case111() + } + } else case111() + } + case101() + } + } + } + def $anonfun$unbox$1( + val tree$6: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$1: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$10: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["unboxing ",": "," as a ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$6.showSummary(ctx$10) + },{ + tree$6.tpe() + },pt$1] + ): + , ctx$10) + def $anonfun$unbox$2( + val tree$7: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$2: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$11: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + { + val selector17: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = pt$2 + { + def case121(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case131(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + val cls: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = pt$2.widen(ctx$11).classSymbol(ctx$11) + if + cls.eq( + dotty.tools.dotc.core.Symbols.defn(ctx$11).UnitClass() + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.constant(tree$7 + , + dotty.tools.dotc.ast.tpd.Literal( + dotty.tools.dotc.core.Constants.Constant.apply( + scala.runtime.BoxedUnit$#UNIT + ) + , ctx$11) + , ctx$11) + else { + assert( + cls.ne( + dotty.tools.dotc.core.Symbols.defn(ctx$11).ArrayClass( + ) + ) + ) + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.transform.Erasure.Boxing.unboxMethod( + cls.asClass() + , ctx$11) + , ctx$11) + ).appliedTo(tree$7, ctx$11) + } + } + } + } + if + selector17.isInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + then { + val x24: + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + = + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + { + val o41: Option = + dotty.tools.dotc.core.TypeErasure.ErasedValueType.unapply( + selector17.asInstanceOf[ + dotty.tools.dotc.core.TypeErasure. + dotty$tools$dotc$core$TypeErasure$$ErasedValueType + ] + ) + if o41.isDefined() then { + val x34: Tuple2 = o41.get().asInstanceOf[Tuple2] + { + val clazz: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + = + x34._1().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$ClassSymbol + ] + val underlying: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x34._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + { + val tree1: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + if + tree$7.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].isRef( + dotty.tools.dotc.core.Symbols.defn(ctx$11). + NullClass + () + , ctx$11).&&( + dotty.tools.dotc.transform.TypeUtils. + decorateTypeUtils + (underlying).isPrimitiveValueType(ctx$11) + ) + then + dotty.tools.dotc.transform.Erasure.Boxing.unbox( + tree$7 + , underlying, ctx$11) + else + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.transform.Erasure.Boxing. + adaptToType + (tree$7, + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$11).typeRef(ctx$11) + , ctx$11) + ).select( + dotty.tools.dotc.transform.ValueClasses. + valueClassUnbox + ( + dotty.tools.dotc.core.Symbols.toClassDenot( + clazz + , ctx$11) + , ctx$11) + , ctx$11) + ).appliedToNone(ctx$11) + dotty.tools.dotc.transform.Erasure.Boxing.cast(tree1, + pt$2 + , ctx$11) + } + } + } + } else case131() + } + } else case131() + } + case121() + } + } + } + } + class Typer extends dotty.tools.dotc.typer.ReTyper with + dotty.tools.dotc.typer + .NoChecking { + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + = { + Typer.super() + Typer.super[NoChecking]() + () + } + def checkNonCyclic( + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val info: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TypeBounds + , val reportErrors: Boolean, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkNonCyclic(sym, info, reportErrors, ctx) + def checkValue( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val proto: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.super[NoChecking].checkValue(tree, proto, ctx) + def checkBounds(val args: scala.collection.immutable.List, + val poly: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$PolyType + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkBounds(args, poly, ctx) + def checkStable( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkStable(tp, pos, ctx) + def checkLegalPrefix( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val selector: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkLegalPrefix(tp, selector, pos, ctx) + def checkClassTypeWithStablePrefix( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , val traitReq: Boolean, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkClassTypeWithStablePrefix(tp, pos, traitReq + , + ctx) + def checkImplicitParamsNotSingletons( + val vparamss: scala.collection.immutable.List + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = + Typer.super[NoChecking].checkImplicitParamsNotSingletons(vparamss, ctx) + def checkFeasible( + val tp: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val pos: + dotty.tools.dotc.util.Positions. + dotty$tools$dotc$util$Positions$$Position + , val where: ()String, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = + Typer.super[NoChecking].checkFeasible(tp, pos, + where().asInstanceOf[Function0] + , ctx) + def checkNoDoubleDefs( + val cls: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): Unit = Typer.super[NoChecking].checkNoDoubleDefs(cls, ctx) + def checkFeasible$default$3(): String = + Typer.super[NoChecking].checkFeasible$default$3() + def erasedType( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type = { + val selector110: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = tree.typeOpt() + { + def case181(): + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = { + def case191(): + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = { + { + val tp: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = selector110 + { + dotty.tools.dotc.core.TypeErasure.erasure(tp, ctx) + } + } + } + if + selector110.isInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + ] + then { + val tp: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$TermRef + = + selector110.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$TermRef + ] + { + if tree.isTerm() then { + dotty.tools.dotc.core.TypeErasure.erasedRef(tp, ctx) + } else case191() + } + } else case191() + } + case181() + } + } + def promote( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + assert(tree.hasType()) + val erased: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = Typer.this.erasedType(tree, ctx) + ctx.log({ + closure(tree, ctx, erased | Typer.this.$anonfun$promote$1:Function0) + }) + tree.withType(erased, ctx) + } + def typedLiteral( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal + , + val ctc: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal = + if + tree.typeOpt().isRef( + dotty.tools.dotc.core.Symbols.defn(ctc).UnitClass() + , ctc) + then + tree.withType(tree.typeOpt(), ctc).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Literal + ] + else super.typedLiteral(tree, ctc) + def typedSelect( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = tree.symbol(ctx) + assert(dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).exists(), { + closure(tree, ctx | Typer.this.$anonfun$typedSelect$1:Function0) + }) + Typer.this.recur$1(tree, pt, ctx, sym, + Typer.this.typed(tree.qualifier(), + dotty.tools.dotc.typer.ProtoTypes.AnySelectionProto + , ctx) + ) + } + def typedSelectFromTypeTree( + val tree: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$SelectFromTypeTree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.untpd.Ident(tree.name()).withPos(tree.pos()). + asInstanceOf + [dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree].withType( + Typer.this.erasedType(tree, ctx) + , ctx) + def typedThis( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + tree.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.toDenot(ctx.owner(), ctx). + enclosingClass + (ctx) + ).||( + dotty.tools.dotc.core.Symbols.toDenot(tree.symbol(ctx), ctx). + isStaticOwner + (ctx) + ) + then Typer.this.promote(tree, ctx) else { + ctx.log({ + closure(tree, ctx | Typer.this.$anonfun$typedThis$1:Function0) + }) + dotty.tools.dotc.transform.ExplicitOuter.outer(ctx).path( + tree.symbol(ctx) + ) + } + def runtimeCallWithProtoArgs( + val name: dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val args: scala.collection.Seq + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val meth: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + val followingParams: scala.collection.immutable.List = + dotty.tools.dotc.core.Symbols.toDenot(meth, ctx).info(ctx). + firstParamTypes + ().drop(args.length()) + val followingArgs: scala.collection.immutable.List = + dotty.tools.dotc.core.Decorators.ListDecorator( + Typer.this.protoArgs(pt) + ).zipWithConserve(followingParams, { + closure(ctx | Typer.this.$anonfun$7) + }): scala.collection.immutable.List + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.ref( + dotty.tools.dotc.core.Symbols.defn(ctx).runtimeMethod(name) + , ctx) + ).appliedToArgs( + args.toList().++(followingArgs, + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + , ctx) + } + def protoArgs( + val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): scala.collection.immutable.List = { + val selector114: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = pt + { + def case251(): scala.collection.immutable.List = { + def case261(): scala.collection.immutable.List = { + { + { + scala.package.Nil() + } + } + } + if + selector114.isInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + then { + val pt: + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + = + selector114.asInstanceOf[ + dotty.tools.dotc.typer.ProtoTypes. + dotty$tools$dotc$typer$ProtoTypes$$FunProto + ] + { + { + pt.args().++(Typer.this.protoArgs(pt.resultType()), + scala.collection.immutable.List.canBuildFrom() + ).asInstanceOf[scala.collection.immutable.List] + } + } + } else case261() + } + case251() + } + } + def typedTypeApply( + val tree: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeApply + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val ntree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.transform.Erasure.interceptTypeApply( + tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeApply + , ctx) + { + val selector116: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = ntree + { + def case291(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case301(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + Typer.this.typedExpr(ntree, pt, ctx) + } + } + } + if + selector116.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + then { + val x29: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + = + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + { + val o43: Option = + dotty.tools.dotc.ast.Trees.TypeApply.unapply( + selector116.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$TypeApply + ] + ) + if o43.isDefined() then { + val x38: Tuple2 = o43.get().asInstanceOf[Tuple2] + { + val fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x38._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + x38._2().asInstanceOf[scala.collection.immutable.List] + { + { + val fun1: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + Typer.this.typedExpr(fun, + dotty.tools.dotc.core.Types.WildcardType + , ctx) + { + val selector115: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case271(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = { + def case281(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + fun1 + } + } + } + if + selector115.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + ] + then { + val funTpe: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + = + selector115.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$PolyType + ] + { + { + val args1: scala.collection.immutable.List + = + dotty.tools.dotc.core.Decorators. + ListDecorator + (args).mapconserve({ + closure(ctx | Typer.this.$anonfun$12) + }) + dotty.tools.dotc.ast.untpd.cpy().TypeApply + ( + tree, fun1, args1, ctx).withType( + funTpe.instantiate( + dotty.tools.dotc.ast.tpd. + ListOfTreeDecorator + (args1).tpes() + , ctx) + , ctx) + } + } + } else case281() + } + case271() + } + } + } + } + } + } else case301() + } + } else case301() + } + case291() + } + } + } + def typedApply( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val $5$: Tuple2 = { + val selector117: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + { + def case311(): Tuple2 = { + def matchFail171(): Tuple2 = throw new MatchError(selector117) + { + val o31: Option = + dotty.tools.dotc.ast.Trees.Apply.unapply(selector117) + if o31.isDefined() then { + val x210: Tuple2 = o31.get().asInstanceOf[Tuple2] + { + val fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x210._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + x210._2().asInstanceOf[scala.collection.immutable.List] + { + Tuple2.apply(fun, args) + } + } + } else matchFail171() + } + } + case311() + } + } + val fun: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + $5$._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + val args: scala.collection.immutable.List = + $5$._2().asInstanceOf[scala.collection.immutable.List] + if + fun.symbol(ctx).==( + dotty.tools.dotc.core.Symbols.defn(ctx).dummyApply() + ) + then + Typer.this.typedUnadapted( + args.head().asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + , pt, ctx) + else { + val selector119: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + Typer.this.typedExpr(fun, + dotty.tools.dotc.typer.ProtoTypes.FunProto.apply(args, pt, this, + ctx + ) + , ctx) + { + def case341(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def case351(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + { + val fun1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = selector119 + { + { + val selector118: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + { + def case321(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + = { + def case331(): + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + = { + { + { + throw + new MatchError( + dotty.tools.dotc.core.Decorators. + StringInterpolators + ( + StringContext.apply( + Predef.wrapRefArray( + ["tree ", + " has unexpected type of function " + ,", was ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [tree,{ + fun1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].widen(ctx) + },{ + fun.typeOpt().widen(ctx) + }] + ): + , ctx) + ) + } + } + } + if + selector118.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val mt: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector118.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + { + val outers: scala.collection.immutable.List = + dotty.tools.dotc.transform.ExplicitOuter.outer + ( + ctx).args( + fun: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ) + val args1: scala.collection.immutable.List = + { + val $6$: scala.collection.immutable.List = + outers + dotty.tools.dotc.core.Decorators. + ListDecorator + ( + args.++(Typer.this.protoArgs(pt), + scala.collection.immutable.List. + canBuildFrom + () + ).asInstanceOf[ + scala.collection.immutable.List + ].:::($6$) + ) + }.zipWithConserve(mt.paramTypes(), { + closure(ctx | Typer.this.$anonfun$15) + }) + dotty.tools.dotc.ast.untpd.cpy().Apply(tree, + fun1 + , args1, ctx).withType(mt.resultType(), ctx). + asInstanceOf + [ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Apply + ] + } + } + } else case331() + } + case321() + } + } + } + } + } + if + selector119.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + then { + val fun1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = + selector119.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + ] + { + { + fun1 + } + } + } else case351() + } + case341() + } + } + } + def typedSeqLiteral( + val tree: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$SeqLiteral + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$SeqLiteral = + super.typedSeqLiteral(tree, + dotty.tools.dotc.core.TypeErasure.erasure(tree.typeOpt(), ctx) + , ctx) + def typedValDef( + val vdef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$ValDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$ValDef = + super.typedValDef({ + val name$3: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$TermName + = dotty.tools.dotc.ast.untpd.cpy().ValDef$default$2(vdef) + val tpt$1: + dotty.tools.dotc.ast.untpd.dotty$tools$dotc$ast$untpd$$TypedSplice + = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx) + , dotty.tools.dotc.ast.tpd.TypeTree$default$2(), ctx).withPos( + vdef.tpt().pos() + ).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + ) + val rhs$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + dotty.tools.dotc.ast.untpd.cpy().ValDef$default$4(vdef) + dotty.tools.dotc.ast.untpd.cpy().ValDef(vdef, name$3, tpt$1, rhs$1) + }, sym, ctx) + def typedDefDef( + val ddef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + val restpe: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx).info(ctx).resultType() + val ddef1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + = + { + val name$4: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$TermName + = dotty.tools.dotc.ast.untpd.cpy().DefDef$default$2(ddef) + val vparamss$1: scala.collection.immutable.List = { + val $7$: scala.collection.immutable.List = + ddef.vparamss().flatten($conforms()).asInstanceOf[ + scala.collection.immutable.List + ] + scala.package.Nil().::($7$) + } + val tpt$2: + dotty.tools.dotc.ast.untpd.dotty$tools$dotc$ast$untpd$$TypedSplice + = + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + dotty.tools.dotc.ast.tpd.TypeTree(restpe, + dotty.tools.dotc.ast.tpd.TypeTree$default$2() + , ctx).withPos(ddef.tpt().pos()).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + ) + val rhs$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = + { + val selector120: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = ddef.rhs() + { + def case361(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case371(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + ddef.rhs() + } + } + } + if + selector120.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Ident + ] + then { + val x211: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Ident + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + { + val o62: Option = + dotty.tools.dotc.ast.Trees.Ident.unapply( + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + ) + if o62.isDefined() then { + val x39: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = + o62.get().asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + ] + { + val p47: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$Name + = x39 + if + dotty.tools.dotc.core.StdNames.nme().WILDCARD().equals + ( + p47) + then { + val x54: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TermName + = + p47.asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TermName + ] + { + val id: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + = + selector120.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Ident + ] + { + dotty.tools.dotc.ast.untpd.TypedSplice.apply( + id.withType(restpe, ctx) + ) + } + } + } else case371() + } + } else case371() + } + } else case371() + } + case361() + } + } + dotty.tools.dotc.ast.untpd.cpy().DefDef(ddef, name$4, + scala.package.Nil() + , vparamss$1, tpt$2, rhs$2) + } + super.typedDefDef(ddef1, sym, ctx) + } + def typedTypeDef( + val tdef: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$TypeDef + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.tpd.EmptyTree() + def typedStats(val stats: scala.collection.immutable.List, + val exprOwner: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): scala.collection.immutable.List = { + val stats1: scala.collection.immutable.List = + dotty.tools.dotc.ast.Trees.flatten( + super.typedStats(stats, exprOwner, ctx) + ) + if ctx.owner().isClass() then { + val $8$: scala.collection.immutable.List = stats1 + Typer.this.addBridges(stats, stats1, ctx).:::($8$) + } else stats1 + } + def addBridges(val oldStats: scala.collection.immutable.List, + val newStats: scala.collection.immutable.List + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): scala.collection.immutable.List = { + val beforeCtx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + = + ctx.withPhase( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx).erasurePhase() + ) + Typer.this.traverse$1(ctx, beforeCtx, newStats, oldStats, + traverse$default$3$1() + ) + } + def makeBridgeDef( + val newDef: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + val bridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + = + { + val owner$3: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + () + val name$5: + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = parentSym.name(ctx) + val flags$1: + dotty.tools.dotc.core.Flags.dotty$tools$dotc$core$Flags$$FlagSet + = + dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).flags(ctx).| + ( + dotty.tools.dotc.core.Flags.Bridge()) + val info$3: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = dotty.tools.dotc.core.Symbols.toDenot(parentSym, ctx).info(ctx) + val privateWithin$2: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = ctx.newSymbol$default$5() + ctx.newSymbol(owner$3, name$5, flags$1, info$3, privateWithin$2, + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().coord() + ) + }.asTerm(ctx) + bridge.enteredAfter( + ctx.phase().prev().asInstanceOf[ + dotty.tools.dotc.core.DenotTransformers. + dotty$tools$dotc$core$DenotTransformers$$DenotTransformer + ] + , ctx) + ctx.debuglog({ + closure(newDef, ctx, bridge | Typer.this.$anonfun$makeBridgeDef$1: + Function0 + ) + }) + val sel: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + dotty.tools.dotc.ast.tpd.TreeOps( + dotty.tools.dotc.ast.tpd.This( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + owner + ().asClass() + , ctx) + ).select( + dotty.tools.dotc.core.Symbols.toDenot(newDef.symbol(ctx), ctx). + termRef + (ctx) + , ctx) + val resultType: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + dotty.tools.dotc.core.Symbols.toDenot(bridge, ctx).info(ctx).widen(ctx + ) + .resultType() + dotty.tools.dotc.ast.tpd.DefDef(bridge, { + { + closure(newDef, parentSym, ctx, sel, resultType | + Typer.this.$anonfun$makeBridgeDef$2 + ) + } + }, ctx) + } + def adapt( + val tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type, + val original: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val printer$1: + dotty.tools.dotc.config.Printers. + dotty$tools$dotc$config$Printers$$Printer + = ctx.traceIndented$default$2() + ctx.traceIndented({ + closure(tree, pt, ctx | Typer.this.$anonfun$adapt$1:Function0) + }, printer$1, true, { + closure(tree, pt, ctx | Typer.this.$anonfun$adapt$2:Function0) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + } + def $anonfun$promote$1( + val tree$8: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val ctx$12: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val erased$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): String = + StringContext.apply( + Predef.wrapRefArray(["promoting ",": ",""]): + ).s( + Predef.wrapRefArray( + [{ + tree$8.show(ctx$12) + },{ + erased$1.showWithUnderlying( + erased$1.showWithUnderlying$default$1() + , ctx$12) + }] + ): + ) + def $anonfun$typedSelect$1( + val tree$9: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , + val ctx$13: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = tree$9.show(ctx$13) + def select$1( + val tree$10: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , + val ctx$14: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val name: dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = + { + val selector111: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = tree$10.typeOpt() + { + def case201(): + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = { + def case211(): + dotty.tools.dotc.core.Names.dotty$tools$dotc$core$Names$$Name + = { + { + { + sym.name(ctx$14) + } + } + } + if + selector111.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + ] + then { + val tp: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + = + selector111.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$NamedType + ] + { + if + dotty.tools.dotc.core.NameOps.NameDecorator(tp.name()). + isInheritedName + () + then { + dotty.tools.dotc.core.NameOps.NameDecorator(sym.name(ctx$14) + ) + .inheritedName() + } else case211() + } + } else case211() + } + case201() + } + } + dotty.tools.dotc.ast.untpd.cpy().Select(tree$10, qual, sym.name(ctx$14) + , + ctx$14).withType( + dotty.tools.dotc.core.Types.NamedType.withFixedSym( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ] + , sym, ctx$14) + , ctx$14) + } + def selectArrayMember$1( + val tree$11: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt$3: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$15: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val erasedPre: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + def tailLabel14( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , + val erasedPre: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + if + erasedPre.isRef( + dotty.tools.dotc.core.Symbols.defn(ctx$15).ObjectClass() + , ctx$15) + then + $this.runtimeCallWithProtoArgs( + dotty.tools.dotc.core.NameOps.NameDecorator(tree$11.name()). + genericArrayOp + () + , pt$3, Predef.wrapRefArray([qual]): , ctx$15) + else + if + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].<:<(erasedPre, ctx$15).unary_!() + then + tailLabel14($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual, erasedPre, + ctx$15 + ) + , erasedPre) + else + $this.assignType( + dotty.tools.dotc.ast.untpd.cpy().Select(tree$11, qual, + dotty.tools.dotc.core.NameOps.NameDecorator(tree$11.name()). + primitiveArrayOp + () + , ctx$15) + , qual, ctx$15) + tailLabel14(Typer.this, qual, erasedPre) + } + def adaptIfSuper$1( + val ctx$16: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + val selector113: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = qual + { + def case231(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def case241(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + { + { + qual + } + } + } + if + selector113.isInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + ] + then { + val x28: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + = + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Super + ] + { + val o61: Option = + dotty.tools.dotc.ast.Trees.Super.unapply( + selector113.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Super + ] + ) + if o61.isDefined() then { + val x37: Tuple2 = o61.get().asInstanceOf[Tuple2] + { + val thisQual: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x37._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val p46: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + = + x37._2().asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + ] + if + dotty.tools.dotc.core.StdNames.tpnme().EMPTY().equals(p46) + then { + val x53: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + = + p46: + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + { + { + val $4$: Tuple2 = { + val selector112: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ]: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + { + def case221(): Tuple2 = { + def matchFail121(): Tuple2 = + throw new MatchError(selector112) + if + selector112.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + then { + val x27: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + = + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + { + val o42: Option = + dotty.tools.dotc.core.Types.SuperType. + unapply + ( + selector112.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$SuperType + ] + ) + if o42.isDefined() then { + val x36: Tuple2 = + o42.get().asInstanceOf[Tuple2] + { + val thisType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x36._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val supType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + x36._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + { + Tuple2.apply(thisType, supType) + } + } + } else matchFail121() + } + } else matchFail121() + } + case221() + } + } + val thisType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $4$._1().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + val supType: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + = + $4$._2().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + if + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$1, + ctx$16 + ).owner() + , ctx$16).is(dotty.tools.dotc.core.Flags.Trait(), + ctx$16 + ) + then + dotty.tools.dotc.ast.tpd.cpy().Super(qual, thisQual + , + dotty.tools.dotc.core.Symbols.toDenot(sym$1, ctx$16) + . + owner().asClass().name(ctx$16).asInstanceOf[ + dotty.tools.dotc.core.Names. + dotty$tools$dotc$core$Names$$TypeName + ] + ).withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$1, + ctx$16 + ).owner() + , ctx$16).typeRef(ctx$16) + , ctx$16) + , ctx$16) + else + qual.withType( + dotty.tools.dotc.core.Types.SuperType.apply( + thisType + , thisType.firstParent(ctx$16), ctx$16) + , ctx$16) + } + } + } else case241() + } + } else case241() + } + } else case241() + } + case231() + } + } + def $anonfun$9( + val ctx$18: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply(Predef.wrapRefArray(["",""]): ).s( + Predef.wrapRefArray( + [{ + sym$3.showLocated(ctx$18) + }] + ): + ) + def recur$1( + val tree$12: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Select + , val pt$4: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$17: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + def tailLabel16( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val qual: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree) + : + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val qualIsPrimitive: Boolean = + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$17) + ).isPrimitiveValueType(ctx$17) + val symIsPrimitive: Boolean = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner() + , ctx$17).isPrimitiveValueClass(ctx$17) + if + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx$17).AnyClass() + ).||( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner().eq( + dotty.tools.dotc.core.Symbols.defn(ctx$17).AnyValClass() + ) + ) + then { + assert( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).isConstructor + ( + ) + , { + closure(ctx$17, sym$2 | Typer.this.$anonfun$9:Function0) + }) + Typer.this.select$1(tree$12, ctx$17, qual, + dotty.tools.dotc.core.Symbols.toClassDenot( + dotty.tools.dotc.core.Symbols.defn(ctx$17).ObjectClass() + , ctx$17).info(ctx$17).decl(sym$2.name(ctx$17), ctx$17).symbol() + ) + } else + if + qualIsPrimitive.&&(symIsPrimitive.unary_!()).||( + dotty.tools.dotc.transform.TypeUtils.decorateTypeUtils( + qual.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ] + ).isErasedValueType(ctx$17) + ) + then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.box(qual, { + closure($anonfun$17:Function0) + }, ctx$17) + ) + else + if qualIsPrimitive.unary_!().&&(symIsPrimitive) then + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.unbox(qual, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner + ( + ) + , ctx$17).typeRef(ctx$17) + , ctx$17) + ) + else + if + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner(). + eq + (dotty.tools.dotc.core.Symbols.defn(ctx$17).ArrayClass()) + then + Typer.this.selectArrayMember$1(tree$12, pt$4, ctx$17, qual, + dotty.tools.dotc.core.TypeErasure.erasure( + tree$12.qualifier().typeOpt().widen(ctx$17). + finalResultType + () + , ctx$17) + ) + else { + val qual1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = Typer.this.adaptIfSuper$1(ctx$17, sym$2, qual) + if + qual1.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$Type + ].derivesFrom( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17).owner + ( + ) + , ctx$17).||( + qual1.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Super + ] + ) + then Typer.this.select$1(tree$12, ctx$17, qual1, sym$2) else + tailLabel16($this, + dotty.tools.dotc.transform.Erasure.Boxing.cast(qual1, + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(sym$2, ctx$17). + owner + () + , ctx$17).typeRef(ctx$17) + , ctx$17) + ) + } + } + tailLabel16(Typer.this, qual) + } + def $anonfun$typedThis$1( + val tree$13: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$This + , + val ctx$19: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray( + ["computing outer path from ","%, % to ",", encl class = ",""] + ): + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(ctx$19.owner(), ctx$19). + ownersIterator + (ctx$19).toList() + },{ + tree$13.symbol(ctx$19) + },{ + dotty.tools.dotc.core.Symbols.toDenot(ctx$19.owner(), ctx$19). + enclosingClass + (ctx$19) + }] + ): + , ctx$19) + def $anonfun$7( + val ctx$20: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.typedExpr(tree, pt, ctx$20) + def $anonfun$12( + val ctx$21: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , _$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = Typer.this.typedType(_$1, Typer.this.typedType$default$2(), ctx$21) + def $anonfun$15( + val ctx$22: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , tree: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + pt: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.typedExpr(tree, pt, ctx$22) + def $anonfun$6( + val ctx$24: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$2: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val oldSymbol$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newSymbol$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply( + Predef.wrapRefArray([""," bridging with ",""]): + ).s( + Predef.wrapRefArray( + [{ + oldSymbol$1.name(beforeCtx$2) + },{ + newSymbol$1.name(ctx$24) + }] + ): + ) + def stillInBaseClass$1( + val ctx$25: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(ctx$25.owner(), ctx$25). + derivesFrom + (dotty.tools.dotc.core.Symbols.toDenot(sym, ctx$25).owner(), ctx$25) + def $anonfun$16( + val ctx$43: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val sym: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = Typer.this.stillInBaseClass$1(ctx$43, sym) + def $anonfun$20( + val ctx$27: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + nxtBridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Boolean = + dotty.tools.dotc.core.Symbols.toDenot(bridge$1, ctx$27).info(ctx$27).=:= + ( + dotty.tools.dotc.core.Symbols.toDenot(nxtBridge, ctx$27).info(ctx$27), + ctx$27 + ).unary_!() + def $anonfun$8( + val ctx$28: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : Boolean = { + sym.name(ctx$28).eq(bridge$2.name(ctx$28)).&&( + dotty.tools.dotc.core.Symbols.toDenot(sym, ctx$28).info(ctx$28).widen( + ctx$28 + ).=:=( + dotty.tools.dotc.core.Symbols.toDenot(bridge$2, ctx$28).info(ctx$28) + . + widen(ctx$28) + , ctx$28) + ) + } + def $anonfun$$anonfun$19$1( + val ctx$30: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$4: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val stat: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef) + : + Boolean = + stat.name().==(bridge$4.name(ctx$30)).&&( + stat.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$30).=:=( + dotty.tools.dotc.core.Symbols.toDenot(bridge$4, ctx$30).info(ctx$30) + . + widen(ctx$30) + , ctx$30) + ) + def $anonfun$$anonfun$2( + val ctx$31: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val _$2: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef) + : + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol = + _$2.symbol(ctx$31) + def $anonfun$19( + val ctx$29: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val emittedBridges$2: scala.collection.mutable.ListBuffer, + val bridge$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Option = + emittedBridges$2.find({ + closure(ctx$29, bridge$3 | Typer.this.$anonfun$$anonfun$19$1) + }).map({ + closure(ctx$29 | Typer.this.$anonfun$$anonfun$2) + }) + def $anonfun$14( + val ctx$32: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$4: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val newSymbol$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val bridge$5: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val cl$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["bridge for method "," of type ","\\n"]): + + ) + ).i( + Predef.wrapRefArray( + [{ + newSymbol$3.showLocated(beforeCtx$4) + },{ + dotty.tools.dotc.core.Symbols.toDenot(newSymbol$3, ctx$32).info( + beforeCtx$4 + ) + }] + ): + , ctx$32).+( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["clashes with "," of type ","\\n"]): + + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot(cl$1, ctx$32).symbol(). + showLocated + (beforeCtx$4) + },{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(cl$1, ctx$32).symbol() + , ctx$32).info(beforeCtx$4) + }] + ): + , ctx$32) + ).+( + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["both have same type after erasure: ",""]): + + ) + ).i( + Predef.wrapRefArray( + [{ + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(bridge$5, ctx$32).symbol + ( + ) + , ctx$32).info(ctx$32) + }] + ): + , ctx$32) + ) + def $anonfun$3( + val ctx$26: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$3: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val emittedBridges$1: scala.collection.mutable.ListBuffer, + val oldSymbol$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val newSymbol$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , val minimalSet$1: scala.runtime.ObjectRef, + val bridge: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): Unit = { + val isRequired: Boolean = + minimalSet$1.elem.asInstanceOf[scala.collection.immutable.Set].forall( + { + closure(ctx$26, bridge | Typer.this.$anonfun$20) + }) + if isRequired then { + val clash: Option = + dotty.tools.dotc.core.Symbols.toDenot( + dotty.tools.dotc.core.Symbols.toDenot(oldSymbol$2, ctx$26).owner() + , ctx$26).decls(ctx$26).lookupAll(bridge.name(ctx$26), ctx$26).find( + { + { + closure(ctx$26, bridge | Typer.this.$anonfun$8) + } + }).orElse({ + closure(ctx$26, emittedBridges$1, bridge | Typer.this.$anonfun$19: + Function0 + ) + }) + { + val selector121: Option = clash + { + def case381(): Unit = { + def case391(): Unit = { + def matchFail211(): Unit = throw new MatchError(selector121) + if None.equals(selector121) then { + val x41: None$ = selector121.asInstanceOf[None$] + { + { + minimalSet$1.elem = + minimalSet$1.elem.asInstanceOf[ + scala.collection.immutable.Set + ].+(bridge).asInstanceOf[ + scala.collection.immutable.Set + ] + } + } + } else matchFail211() + } + if selector121.isInstanceOf[Some] then { + val x212: Some = selector121.asInstanceOf[Some] + { + val o53: Option = + Some.unapply(selector121.asInstanceOf[Some]) + if o53.isDefined() then { + val x310: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = + o53.get().asInstanceOf[ + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + ] + { + val cl: + dotty.tools.dotc.core.Symbols. + dotty$tools$dotc$core$Symbols$$Symbol + = x310 + { + { + ctx$26.error({ + closure(ctx$26, beforeCtx$3, newSymbol$2, bridge, + cl + | Typer.this.$anonfun$14:Function0) + }, ctx$26.error$default$2()) + } + } + } + } else case391() + } + } else case391() + } + case381() + } + } + } else () + } + def $anonfun$18( + val ctx$33: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val $this$1: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , + val member$1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , sym: dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ) + : dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef = { + $this$1.makeBridgeDef(member$1, sym, ctx$33) + } + def traverse$1( + val ctx$23: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val beforeCtx$1: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + def tailLabel30( + val $this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer + , val after: scala.collection.immutable.List, + val before: scala.collection.immutable.List + , val emittedBridges: scala.collection.mutable.ListBuffer): + scala.collection.immutable.List + = { + { + val selector123: scala.collection.immutable.List = after + { + def case431(): scala.collection.immutable.List = { + def case441(): scala.collection.immutable.List = { + def case451(): scala.collection.immutable.List = { + def matchFail231(): scala.collection.immutable.List = + throw new MatchError(selector123) + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x65: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.::] + { + val o82: Option = + scala.package.::().unapply( + selector123.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o82.isDefined() then { + val x73: Tuple2 = o82.get().asInstanceOf[Tuple2] + { + val newTail: scala.collection.immutable.List = + x73._2().asInstanceOf[ + scala.collection.immutable.List + ] + { + { + tailLabel30($this, newTail, before, + traverse$default$3$1() + ) + } + } + } + } else matchFail231() + } + } else matchFail231() + } + if selector123.isInstanceOf[scala.collection.immutable.::] + then + { + val x312: scala.collection.immutable.:: = + selector123.asInstanceOf[scala.collection.immutable.::] + { + val o94: Option = + scala.package.::().unapply( + selector123.asInstanceOf[scala.collection.immutable.:: + ] + ) + if o94.isDefined() then { + val x43: Tuple2 = o94.get().asInstanceOf[Tuple2] + { + val pi52: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x43._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val newTail: scala.collection.immutable.List = + x43._2().asInstanceOf[ + scala.collection.immutable.List + ] + if + pi52.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + then { + val member: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + = + pi52.asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + { + { + { + val selector122: + scala.collection.immutable.List + = before + { + def case401(): + scala.collection.immutable.List + = { + def case411(): + scala.collection.immutable.List + = { + def case421(): + scala.collection.immutable.List + = { + def matchFail221(): + scala.collection.immutable.List + = throw new MatchError(selector122) + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x64: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o81: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable. + :: + ] + ) + if o81.isDefined() then { + val x72: Tuple2 = + o81.get().asInstanceOf[Tuple2] + { + val oldTail: + scala.collection.immutable. + List + = + x72._2().asInstanceOf[ + scala.collection.immutable + . + List + ] + { + { + tailLabel30($this, after, + oldTail + , traverse$default$3$1()) + } + } + } + } else matchFail221() + } + } else matchFail221() + } + if + selector122.isInstanceOf[ + scala.collection.immutable.:: + ] + then { + val x311: + scala.collection.immutable.:: + = + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + { + val o93: Option = + scala.package.::().unapply( + selector122.asInstanceOf[ + scala.collection.immutable.:: + ] + ) + if o93.isDefined() then { + val x42: Tuple2 = + o93.get().asInstanceOf[Tuple2] + { + val pi51: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + = + x42._1().asInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$Tree + ] + val oldTail: + scala.collection.immutable. + List + = + x42._2().asInstanceOf[ + scala.collection.immutable. + List + ] + if + pi51.isInstanceOf[ + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + ] + then { + val oldMember: + dotty.tools.dotc.ast.Trees. + dotty$tools$dotc$ast$Trees$$DefDef + = + pi51.asInstanceOf[ + dotty.tools.dotc.ast.Trees + . + dotty$tools$dotc$ast$Trees$$DefDef + ] + { + { + val oldSymbol: + dotty.tools.dotc.core.Symbols + . + dotty$tools$dotc$core$Symbols$$Symbol + = + oldMember.symbol( + beforeCtx$1 + ) + val newSymbol: + dotty.tools.dotc.core.Symbols + . + dotty$tools$dotc$core$Symbols$$Symbol + = member.symbol(ctx$23) + assert( + oldSymbol.name( + beforeCtx$1 + ).==( + newSymbol.name(ctx$23) + ) + , { + closure(ctx$23, + beforeCtx$1 + , oldSymbol, newSymbol + | + Typer.this.$anonfun$6: + Function0 + ) + }) + val newOverridden: + scala.collection.immutable + . + Set + = + oldSymbol.denot(ctx$23). + allOverriddenSymbols + (ctx$23).toSet() + val oldOverridden: + scala.collection.immutable + . + Set + = + dotty.tools.dotc.core. + Symbols + .toDenot(newSymbol, + ctx$23 + ).allOverriddenSymbols( + beforeCtx$1 + ).toSet() + val neededBridges: + scala.collection.immutable + . + Set + = + oldOverridden.--( + newOverridden + ).asInstanceOf[ + scala.collection. + TraversableLike + ].filter({ + closure(ctx$23 | + Typer.this. + $anonfun$16 + ) + }).asInstanceOf[ + scala.collection.immutable + . + Set + ] + val minimalSet: + scala.runtime.ObjectRef + = + scala.runtime.ObjectRef$ + # + create( + Set().apply( + Predef. + genericWrapArray + ([]): + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + ) + neededBridges.foreach({ + closure(ctx$23, + beforeCtx$1 + , emittedBridges, + oldSymbol + , newSymbol, minimalSet + | + Typer.this.$anonfun$3) + }) + val bridgeImplementations + : + scala.collection.immutable + . + Set + = + minimalSet.elem. + asInstanceOf + [ + scala.collection.immutable + . + Set + ].map({ + { + closure(ctx$23, + $this + , member | + Typer.this. + $anonfun$18 + ) + } + }, + scala.collection.immutable + . + Set.canBuildFrom() + ).asInstanceOf[ + scala.collection.immutable + . + Set + ] + emittedBridges.++=( + bridgeImplementations + ) + tailLabel30($this, newTail + , + oldTail, + traverse$default$3$1() + ) + } + } + } else case421() + } + } else case421() + } + } else case421() + } + if scala.package.Nil().equals(selector122) + then + { + val x213: + scala.collection.immutable.Nil$ + = + selector122.asInstanceOf[ + scala.collection.immutable.Nil$ + ] + { + { + emittedBridges.toList() + } + } + } else case411() + } + case401() + } + } + } + } + } else case451() + } + } else case451() + } + } else case451() + } + if scala.package.Nil().equals(selector123) then { + val x214: scala.collection.immutable.Nil$ = + selector123.asInstanceOf[scala.collection.immutable.Nil$] + { + { + emittedBridges.toList() + } + } + } else case441() + } + case431() + } + } + } + tailLabel30(Typer.this, after, before, emittedBridges) + } + def $anonfun$error$1( + val newDef$2: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$2: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$35: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val reason$1: String): String = + StringContext.apply( + Predef.wrapRefArray( + ["failure creating bridge from "," to ",", reason: ",""] + ): + ).s( + Predef.wrapRefArray( + [{ + newDef$2.symbol(ctx$35) + },{ + parentSym$2 + },reason$1] + ): + ) + def error$1( + val newDef$1: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$1: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$34: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val reason: String): Nothing = { + assert(false, { + closure(newDef$1, parentSym$1, ctx$34, reason | + Typer.this.$anonfun$error$1 + :Function0) + }) + ???() + } + def $anonfun$makeBridgeDef$1( + val newDef$3: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val ctx$36: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , + val bridge$6: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + ): String = + StringContext.apply( + Predef.wrapRefArray(["generating bridge from "," to ",""]): + ).s( + Predef.wrapRefArray( + [{ + newDef$3.symbol(ctx$36) + },bridge$6] + ): + ) + def $anonfun$$anonfun$1( + val ctx$39: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , _$3: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + _$4: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + Typer.this.adapt(_$3, _$4, dotty.tools.dotc.ast.untpd.EmptyTree(), + ctx$39 + ) + def $anonfun$21( + val newDef$5: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$4: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$38: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , fun: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + vparams: scala.collection.immutable.List + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + val selector124: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = + fun.tpe().asInstanceOf[ + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + ].widen(ctx$38) + { + def case461(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + def case471(): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Apply + = { + { + val a: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + = selector124 + { + Typer.this.error$1(newDef$5, parentSym$4, ctx$38, + StringContext.apply( + Predef.wrapRefArray(["can not resolve apply type ",""]): + + ).s(Predef.wrapRefArray([a]): ) + ) + } + } + } + if + selector124.isInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + then { + val x215: + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + = + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + { + val o44: Option = + dotty.tools.dotc.core.Types.MethodType.unapply( + selector124.asInstanceOf[ + dotty.tools.dotc.core.Types. + dotty$tools$dotc$core$Types$$MethodType + ] + ) + if o44.isDefined() then { + val x313: Tuple2 = o44.get().asInstanceOf[Tuple2] + { + val types: scala.collection.immutable.List = + x313._2().asInstanceOf[scala.collection.immutable.List] + { + { + dotty.tools.dotc.ast.tpd.Apply(fun, + tuple2ToZippedOps(Tuple2.apply(vparams, types)).zipped + ( + $conforms(), $conforms()).map({ + closure(ctx$38 | Typer.this.$anonfun$$anonfun$1) + }, scala.collection.immutable.List.canBuildFrom()). + asInstanceOf + [scala.collection.immutable.List] + , ctx$38) + } + } + } + } else case471() + } + } else case471() + } + case461() + } + } + def $anonfun$makeBridgeDef$2( + val newDef$4: + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$DefDef + , + val parentSym$3: + dotty.tools.dotc.core.Symbols.dotty$tools$dotc$core$Symbols$$Symbol + , + val ctx$37: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + , val sel$1: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree, + val resultType$1: + dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , val paramss: scala.collection.immutable.List): + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + = { + val rhs: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = + paramss.foldLeft(sel$1, { + closure(newDef$4, parentSym$3, ctx$37 | Typer.this.$anonfun$21) + }).asInstanceOf[ + dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + ] + Typer.this.adapt(rhs, resultType$1, Typer.this.adapt$default$3(), ctx$37 + ) + } + def $anonfun$adapt$1( + val tree$14: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$5: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$40: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): String = + dotty.tools.dotc.core.Decorators.StringInterpolators( + StringContext.apply( + Predef.wrapRefArray(["adapting ",": "," to ",""]): + ) + ).i( + Predef.wrapRefArray( + [{ + tree$14.showSummary(ctx$40) + },{ + tree$14.tpe() + },pt$5] + ): + , ctx$40) + def $anonfun$$anonfun$adapt$2$1( + val ctx$42: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.core.Phases.dotty$tools$dotc$core$Phases$$Phase = + ctx$42.phase() + def $anonfun$adapt$2( + val tree$15: dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree + , val pt$6: dotty.tools.dotc.core.Types.dotty$tools$dotc$core$Types$$Type + , + val ctx$41: + dotty.tools.dotc.core.Contexts.dotty$tools$dotc$core$Contexts$$Context + ): dotty.tools.dotc.ast.Trees.dotty$tools$dotc$ast$Trees$$Tree = { + assert( + ctx$41.phase().==( + dotty.tools.dotc.core.Contexts.Context.toBase(ctx$41).erasurePhase() + . + next() + ) + , { + closure(ctx$41 | Typer.this.$anonfun$$anonfun$adapt$2$1:Function0) + }) + if tree$15.isEmpty() then tree$15 else + if ctx$41.mode().is(dotty.tools.dotc.typer.Mode.Pattern()) then + tree$15 + else + dotty.tools.dotc.transform.Erasure.Boxing.adaptToType(tree$15, pt$6 + , + ctx$41) + } + } + class Typer$ extends Object { + this: + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + => + + def (): + dotty.tools.dotc.transform.Erasure. + dotty$tools$dotc$transform$Erasure$$Typer$ + = { + Typer$.super() + () + } + } + } +}