@@ -243,10 +243,8 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
243243 private object dropInlines extends TreeMap {
244244 override def transform (tree : Tree )(using Context ): Tree = tree match {
245245 case Inlined (call, _, expansion) =>
246- val newExpansion = tree.tpe match
247- case ConstantType (c) => Literal (c)
248- case _ => Typed (ref(defn.Predef_undefined ), TypeTree (tree.tpe))
249- cpy.Inlined (tree)(call, Nil , newExpansion.withSpan(tree.span))
246+ val newExpansion = PruneErasedDefs .trivialErasedTree(tree)
247+ cpy.Inlined (tree)(call, Nil , newExpansion)
250248 case _ => super .transform(tree)
251249 }
252250 }
@@ -282,7 +280,8 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
282280 tpd.cpy.Apply (tree)(
283281 tree.fun,
284282 tree.args.mapConserve(arg =>
285- if (methType.isImplicitMethod && arg.span.isSynthetic) ref(defn.Predef_undefined )
283+ if (methType.isImplicitMethod && arg.span.isSynthetic)
284+ PruneErasedDefs .trivialErasedTree(arg)
286285 else dropInlines.transform(arg)))
287286 else
288287 tree
@@ -414,12 +413,12 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
414413 // case x: (_: Tree[?])
415414 case m @ MatchTypeTree (bounds, selector, cases) =>
416415 // Analog to the case above for match types
417- def tranformIgnoringBoundsCheck (x : CaseDef ): CaseDef =
416+ def transformIgnoringBoundsCheck (x : CaseDef ): CaseDef =
418417 withMode(Mode .Pattern )(super .transform(x)).asInstanceOf [CaseDef ]
419418 cpy.MatchTypeTree (tree)(
420419 super .transform(bounds),
421420 super .transform(selector),
422- cases.mapConserve(tranformIgnoringBoundsCheck )
421+ cases.mapConserve(transformIgnoringBoundsCheck )
423422 )
424423 case Block (_, Closure (_, _, tpt)) if ExpandSAMs .needsWrapperClass(tpt.tpe) =>
425424 superAcc.withInvalidCurrentClass(super .transform(tree))
0 commit comments