@@ -66,7 +66,9 @@ object Inliner {
66
66
override def transform (tree : Tree )(implicit ctx : Context ): Tree =
67
67
super .transform(accessorIfNeeded(tree)) match {
68
68
case tree1 @ Assign (lhs : RefTree , rhs) if lhs.symbol.name.is(InlineAccessorName ) =>
69
- cpy.Apply (tree1)(useSetter(lhs), rhs :: Nil )
69
+ val setter = useSetter(lhs)
70
+ if (inlineSym.isTransparentMethod) tree1 // just generate a setter, but don't integrate it in the tree
71
+ else cpy.Apply (tree1)(setter, rhs :: Nil )
70
72
case tree1 =>
71
73
tree1
72
74
}
@@ -568,6 +570,18 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
568
570
*/
569
571
trait InlineTyping extends Typer {
570
572
573
+ override def ensureAccessible (tpe : Type , superAccess : Boolean , pos : Position )(implicit ctx : Context ): Type = {
574
+ tpe match {
575
+ case tpe @ TypeRef (pre, _) if ! tpe.symbol.isAccessibleFrom(pre, superAccess) =>
576
+ tpe.info match {
577
+ case TypeAlias (alias) => return ensureAccessible(alias, superAccess, pos)
578
+ case _ =>
579
+ }
580
+ case _ =>
581
+ }
582
+ super .ensureAccessible(tpe, superAccess, pos)
583
+ }
584
+
571
585
override def typedIf (tree : untpd.If , pt : Type )(implicit ctx : Context ) = {
572
586
val cond1 = typed(tree.cond, defn.BooleanType )
573
587
cond1.tpe.widenTermRefExpr match {
@@ -623,18 +637,6 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
623
637
/** A re-typer used for inlined methods */
624
638
private class InlineReTyper extends ReTyper with InlineTyping {
625
639
626
- override def ensureAccessible (tpe : Type , superAccess : Boolean , pos : Position )(implicit ctx : Context ): Type = {
627
- tpe match {
628
- case tpe @ TypeRef (pre, _) if ! tpe.symbol.isAccessibleFrom(pre, superAccess) =>
629
- tpe.info match {
630
- case TypeAlias (alias) => return ensureAccessible(alias, superAccess, pos)
631
- case _ =>
632
- }
633
- case _ =>
634
- }
635
- super .ensureAccessible(tpe, superAccess, pos)
636
- }
637
-
638
640
override def typedIdent (tree : untpd.Ident , pt : Type )(implicit ctx : Context ) =
639
641
tree.asInstanceOf [tpd.Tree ] match {
640
642
case InlineableArg (rhs) => inlining.println(i " inline arg $tree -> $rhs" ); rhs
0 commit comments