trait
Glb[Mixin] extends Serializable
Type Members
-
abstract
type
Out >: Mixin <: Mixin
Abstract Value Members
-
abstract
def
getClass(): Class[_]
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
def
+(other: String): String
-
def
->[B](y: B): (Glb[Mixin], B)
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
ensuring(cond: (Glb[Mixin]) ⇒ Boolean, msg: ⇒ Any): Glb[Mixin]
-
def
ensuring(cond: (Glb[Mixin]) ⇒ Boolean): Glb[Mixin]
-
def
ensuring(cond: Boolean, msg: ⇒ Any): Glb[Mixin]
-
def
ensuring(cond: Boolean): Glb[Mixin]
-
-
def
formatted(fmtstr: String): String
-
final
def
glb(mixin: Mixin): Out
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
def
toString(): String
-
def
→[B](y: B): (Glb[Mixin], B)
Inherited by implicit conversion any2stringadd from
Glb[Mixin] to any2stringadd[Glb[Mixin]]
Inherited by implicit conversion StringFormat from
Glb[Mixin] to StringFormat[Glb[Mixin]]
Inherited by implicit conversion Ensuring from
Glb[Mixin] to Ensuring[Glb[Mixin]]
Inherited by implicit conversion ArrowAssoc from
Glb[Mixin] to ArrowAssoc[Glb[Mixin]]
A type class that converts a mix-in type to the greatest lower bound of the components of the mix-in.
This Glb type class provides an extension method glb via implicit view, which can be import as follow:
import com.thoughtworks.feature.Glb.ops._
Author:
杨博 (Yang Bo) <[email protected]>
Given a mix-in of two refinement components,
when convert it to its greatest lower bound,
val glbOfAB = toAllGlbOps(ab).glb
Then the common method should return the greatest lower bound of each components's return type.
This Glb type class is implemented via scala.reflect.api.Types.glb, which is similar to intersection operator in Dotty, except this Glb works for refinement type only.
,The implicit conversion toAllGlbOps must be explicitly invoked, as a workaround of https://github.com/scala/bug/issues/10671