https://kotlinlang.org logo
Title
f

fatih.yalmanbas

06/29/2018, 8:48 AM
So that way, both from java and kotlin i would use same package and same class name (consistency problem)
n

Nicolas Chaduc

06/29/2018, 8:51 AM
Why you don’t add java method if it’s your class ?
e

edwardwongtl

06/29/2018, 9:00 AM
Seems like this requires
.class
file merging, don’t know if is it possible.
f

fatih.yalmanbas

06/29/2018, 10:02 AM
I do not want to maintain both classes and I want to use it as an extension in kt classes
So there would be just one ViewUtil in whole project. and both kotlin and java classes use that instance
e

edwardwongtl

06/29/2018, 10:08 AM
Seems like you cannot use the trick
@file:JvmName("ViewUtil")
, the compiler will complain the Java class saying
duplicate class found
1
f

fatih.yalmanbas

06/29/2018, 10:09 AM
Exactly, but im wondering if that is possible. Maybe i should ask #language-proposals
e

edwardwongtl

06/29/2018, 10:10 AM
That would require the compiler to merge the two generated
.class
files, which is what I mentioned above.