We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 29e229b + 421591f commit 18259dbCopy full SHA for 18259db
library/src/scala/util/NotGiven.scala
@@ -31,11 +31,13 @@ trait LowPriorityNotGiven {
31
}
32
object NotGiven extends LowPriorityNotGiven {
33
34
+ private val cachedValue = new NotGiven[Nothing]()
35
+
36
/** A value of type `NotGiven` to signal a successful search for `NotGiven[C]` (i.e. a failing
37
* search for `C`). A reference to this value will be explicitly constructed by Dotty's
38
* implicit search algorithm
39
*/
- def value: NotGiven[Nothing] = new NotGiven[Nothing]()
40
+ def value: NotGiven[Nothing] = cachedValue
41
42
/** One of two ambiguous methods used to emulate negation in Scala 2 */
43
given amb1[T](using ev: T): NotGiven[T] = ???
0 commit comments