I cant figure out how to pass that viewClass varia...
# announcements
m
I cant figure out how to pass that viewClass variable as parameter to setRoute... No matter what I do it always complains its the wrong type.
m
Target::class.java ?
m
Already tried every single combination of that
1
::class, ::class.java... ::kotlin... everything hehe
r
use
reified
m
also tried that
apparently no matter what, it always match the first 2 methods on that list
never matches the 3rd or 4th
see, passing a KClass to the method and it requires a Router! It doesn't match the other overrides.
m
maybe it's an IDE thing and it compiles fine ?
m
nope
it is starting to really piss me off 🙂
r
Screenshot 2019-07-30 at 18.02.27.png
maybe is something about dependencies configuration
m
yeah... I think something with that DSL routerLink
k
Are you sure the last two aren't defined elsewhere and need to be explicitly imported?
m
well, they are defined by that DSL that is enclosing everything there "routerLink". So I suppose they should be derived from "this" there. But I'm starting to doubt that too
k
Try pressing enter on them in the suggestion box.
m
nothing out of the ordinary... just let me start typing
val foo = routerLink(icon, caption) foo.setRoute(viewClass)
this works...
its the 3rd override on the screenshot
image.png
once I add "parameter" then both parameters are invalid
ok i kinda figured it out... the viewClass has to implement HasUrlParameter to match the override I want... If I type the class name it works, if it comes from the variable the compiler cant figure it out, I guess
fixed.. a lil hacky but working. thanks for help.