@@ -66,7 +66,9 @@ object Inliner {
6666 override def transform (tree : Tree )(implicit ctx : Context ): Tree =
6767 super .transform(accessorIfNeeded(tree)) match {
6868 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 )
7072 case tree1 =>
7173 tree1
7274 }
@@ -568,6 +570,18 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
568570 */
569571 trait InlineTyping extends Typer {
570572
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+
571585 override def typedIf (tree : untpd.If , pt : Type )(implicit ctx : Context ) = {
572586 val cond1 = typed(tree.cond, defn.BooleanType )
573587 cond1.tpe.widenTermRefExpr match {
@@ -623,18 +637,6 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
623637 /** A re-typer used for inlined methods */
624638 private class InlineReTyper extends ReTyper with InlineTyping {
625639
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-
638640 override def typedIdent (tree : untpd.Ident , pt : Type )(implicit ctx : Context ) =
639641 tree.asInstanceOf [tpd.Tree ] match {
640642 case InlineableArg (rhs) => inlining.println(i " inline arg $tree -> $rhs" ); rhs
0 commit comments