You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type has to of the method has to be specified or else the return types will just be a Double in both cases and the tests will pass.
Strict Equality has to be set for the compiler to fail.
Copy file name to clipboardExpand all lines: _scala3-reference/other-new-features/matchable.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,10 +122,10 @@ For instance, consider the definitions
122
122
123
123
```scala
124
124
opaquetypeMeter=Double
125
-
defMeter(x: Double) = x
125
+
defMeter(x: Double):Meter= x
126
126
127
127
opaquetypeSecond=Double
128
-
defSecond(x: Double) = x
128
+
defSecond(x: Double):Second= x
129
129
```
130
130
131
131
Here, universal `equals` will return true for
@@ -137,6 +137,7 @@ Here, universal `equals` will return true for
137
137
even though this is clearly false mathematically. With [multiversal equality](../contextual/multiversal-equality.html) one can mitigate that problem somewhat by turning
0 commit comments