This message was deleted.
# getting-started
s
This message was deleted.
e
Have you actually tried that?
t
assuming the java
to
method is a static method because an instance based method should always win in the dispatching order afaik. you might either use a more qualified method call or use an import alias to disambiguate without actually refactoring the original method.
j
Tried what? A name change? Yes in this case I do actually have access to the class and could simply change the name. I’m just asking as an exploration of the problem.
e
Can you include a code snippet that actually shows this problem?
I mean, show the code where stdlib’s
to
function gets invoked instead of member method
to
.
j
Copy code
// Java
public class SomeObject {

    public void to(OtherObject foo) {
        System.out.println(foo.toString())
    }
}

// Kotlin
val param = OtherObject()
SomeObject().to(param) // Returns a Pair<SomeObject, OtherObject>
@elizarov super simplified example but that is the basic state of the problem
@trevjones unfortunately it is an instance method
😞 1
k
try SomeObject.`to`(param)
i mean try using backticks( ` )
i
@jhorvat This example works fine for me,
to
is resolved to instance method.
Perhaps the
param
you pass to this method is not
OtherObject
?
t
how would it resolve if param was a subclass of
OtherObject
?
i
To the instance method. I've tried passing Int where OtherObject was Number.