@@ -690,8 +690,10 @@ object Trees {
690690 type ThisTree [- T >: Untyped ] = ByNameTypeTree [T ]
691691 }
692692
693- /** >: lo <: hi */
694- case class TypeBoundsTree [- T >: Untyped ] private [ast] (lo : Tree [T ], hi : Tree [T ])(implicit @ constructorOnly src : SourceFile )
693+ /** >: lo <: hi
694+ * >: lo <: hi = alias for RHS of bounded opaque type
695+ */
696+ case class TypeBoundsTree [- T >: Untyped ] private [ast] (lo : Tree [T ], hi : Tree [T ], alias : Tree [T ])(implicit @ constructorOnly src : SourceFile )
695697 extends TypTree [T ] {
696698 type ThisTree [- T >: Untyped ] = TypeBoundsTree [T ]
697699 }
@@ -760,7 +762,8 @@ object Trees {
760762 /** mods class name template or
761763 * mods trait name template or
762764 * mods type name = rhs or
763- * mods type name >: lo <: hi, if rhs = TypeBoundsTree(lo, hi) & (lo ne hi)
765+ * mods type name >: lo <: hi, if rhs = TypeBoundsTree(lo, hi) or
766+ * mods type name >: lo <: hi = rhs if rhs = TypeBoundsTree(lo, hi, alias) and opaque in mods
764767 */
765768 case class TypeDef [- T >: Untyped ] private [ast] (name : TypeName , rhs : Tree [T ])(implicit @ constructorOnly src : SourceFile )
766769 extends MemberDef [T ] {
@@ -1151,9 +1154,9 @@ object Trees {
11511154 case tree : ByNameTypeTree if (result eq tree.result) => tree
11521155 case _ => finalize(tree, untpd.ByNameTypeTree (result)(sourceFile(tree)))
11531156 }
1154- def TypeBoundsTree (tree : Tree )(lo : Tree , hi : Tree )(implicit ctx : Context ): TypeBoundsTree = tree match {
1155- case tree : TypeBoundsTree if (lo eq tree.lo) && (hi eq tree.hi) => tree
1156- case _ => finalize(tree, untpd.TypeBoundsTree (lo, hi)(sourceFile(tree)))
1157+ def TypeBoundsTree (tree : Tree )(lo : Tree , hi : Tree , alias : Tree )(implicit ctx : Context ): TypeBoundsTree = tree match {
1158+ case tree : TypeBoundsTree if (lo eq tree.lo) && (hi eq tree.hi) && (alias eq tree.alias) => tree
1159+ case _ => finalize(tree, untpd.TypeBoundsTree (lo, hi, alias )(sourceFile(tree)))
11571160 }
11581161 def Bind (tree : Tree )(name : Name , body : Tree )(implicit ctx : Context ): Bind = tree match {
11591162 case tree : Bind if (name eq tree.name) && (body eq tree.body) => tree
@@ -1304,8 +1307,8 @@ object Trees {
13041307 cpy.MatchTypeTree (tree)(transform(bound), transform(selector), transformSub(cases))
13051308 case ByNameTypeTree (result) =>
13061309 cpy.ByNameTypeTree (tree)(transform(result))
1307- case TypeBoundsTree (lo, hi) =>
1308- cpy.TypeBoundsTree (tree)(transform(lo), transform(hi))
1310+ case TypeBoundsTree (lo, hi, alias ) =>
1311+ cpy.TypeBoundsTree (tree)(transform(lo), transform(hi), transform(alias) )
13091312 case Bind (name, body) =>
13101313 cpy.Bind (tree)(name, transform(body))
13111314 case Alternative (trees) =>
@@ -1428,8 +1431,8 @@ object Trees {
14281431 this (this (this (x, bound), selector), cases)
14291432 case ByNameTypeTree (result) =>
14301433 this (x, result)
1431- case TypeBoundsTree (lo, hi) =>
1432- this (this (x, lo), hi)
1434+ case TypeBoundsTree (lo, hi, alias ) =>
1435+ this (this (this ( x, lo), hi), alias )
14331436 case Bind (name, body) =>
14341437 this (x, body)
14351438 case Alternative (trees) =>
0 commit comments