object Good extends Serializable
Companion object for Good
that offers, in addition to the standard factory method
for Good
that takes single “good” type, an parameterless apply
used to narrow the Good
type when creating a Bad
.
- Source
- Or.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Good
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[G]: GoodType[G]
Captures a
Good
type to enable aBad
to be constructed with a specificGood
type.Captures a
Good
type to enable aBad
to be constructed with a specificGood
type.Because
Or
has two types, but theBad
factory method only takes a value of the “bad” type, the Scala compiler will inferNothing
for theGood
type:scala> Bad("oops") res1: org.scalactic.Bad[Nothing,String] = Bad(oops)
Often
Nothing
will work fine, as it will be widened as soon as the compiler encounters a more specificGood
type. Sometimes, however, you may need to specify it. In such situations you can use this factory method, like this:scala> Good[Int].orBad("oops") res3: org.scalactic.Bad[Int,String] = Bad(oops)
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )