File tree Expand file tree Collapse file tree 4 files changed +2
-8
lines changed Expand file tree Collapse file tree 4 files changed +2
-8
lines changed Original file line number Diff line number Diff line change 1
- Meter.scala:72: warning: a.Meter and Int are unrelated: they will never compare equal
2
- println("x == 1: "+(x == 1))
3
- ^
4
1
2.0
5
2
4.0m
6
3
false
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ object Test extends dotty.runtime.LegacyApp {
69
69
70
70
71
71
println(" x.hashCode: " + x.hashCode)
72
- println(" x == 1: " + (x == 1 ))
72
+ println(" x == 1: " + false ) // Values of types a.Meter and Int cannot be compared with == or !=
73
73
println(" x == y: " + (x == y))
74
74
assert(x.hashCode == (1.0 ).hashCode)
75
75
Original file line number Diff line number Diff line change 1
- MeterCaseClass.scala:69: warning: comparing values of types a.Meter and Int using `==' will always yield false
2
- println("x == 1: "+(x == 1))
3
- ^
4
1
2.0
5
2
Meter(4.0)
6
3
false
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ object Test extends dotty.runtime.LegacyApp {
66
66
67
67
68
68
println(" x.hashCode: " + x.hashCode)
69
- println(" x == 1: " + (x == 1 ))
69
+ println(" x == 1: " + false ) // Values of types a.Meter and Int cannot be compared with == or !=
70
70
println(" x == y: " + (x == y))
71
71
assert(x.hashCode == (1.0 ).hashCode)
72
72
You can’t perform that action at this time.
0 commit comments