Skip to content

Commit 6f5bcb8

Browse files
authored
Merge pull request #2166 from bblfish/patch-1
Update matchable.md
2 parents 8bbce58 + a2f2639 commit 6f5bcb8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_scala3-reference/other-new-features/matchable.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ For instance, consider the definitions
122122

123123
```scala
124124
opaque type Meter = Double
125-
def Meter(x: Double) = x
125+
def Meter(x: Double): Meter = x
126126

127127
opaque type Second = Double
128-
def Second(x: Double) = x
128+
def Second(x: Double): Second = x
129129
```
130130

131131
Here, universal `equals` will return true for
@@ -137,6 +137,7 @@ Here, universal `equals` will return true for
137137
even though this is clearly false mathematically. With [multiversal equality](../contextual/multiversal-equality.html) one can mitigate that problem somewhat by turning
138138

139139
```scala
140+
import scala.language.strictEquality
140141
Meter(10) == Second(10)
141142
```
142143

0 commit comments

Comments
 (0)