wei
09/11/2018, 1:49 AMval a = com.mycompany.path1.MyEnum.GOOD
val b = com.mycompany.path2.MyEnum.GOOD
if (a == b) {
println("a == b")
}
This code actually compiles and runs. However, when I created 2 different enum classes by hand and put them into 2 paths, the code won’t compile and it will say something like:
Operator '==' cannot be applied to 'com.mycompany.path1.myEnum' and 'com.mycompany.path2.MyEnum'
Why?Shawn
09/11/2018, 1:51 AMwei
09/11/2018, 1:52 AM/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package com.mycompany.path1 (or path2)
public enum MyEnum {
GOOD, BAD ;
...
}
Dico
09/11/2018, 4:01 AMAny
?ilya.gorbunov
09/11/2018, 4:26 AMwei
09/11/2018, 5:26 AM==
returned true for some cases (it’s a filter operation that we do based on the conditional). However, when I ran this locally in a test, it returned false (in other words, did not print a == b
).Ruckus
09/11/2018, 6:03 PMwei
09/11/2018, 7:00 PM