Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HREF support from a controller member that generated a route #9

Open
apatrida opened this issue Aug 28, 2015 · 2 comments
Open

HREF support from a controller member that generated a route #9

apatrida opened this issue Aug 28, 2015 · 2 comments

Comments

@apatrida
Copy link
Contributor

Given a reference "MyClass::someMethod" that is a bound controller method, return the internal and external URL HREF. This can be done now given a controller that adds methods in the form:

val getSomeThing = fun MyContext.(param: String): MyObject { ... } 

Since Kotlin allow that reference, and the binder already supports binding to it. Just need to remember the information from the route so it can be looked up again.

The other form:

fun MyContext.getSomeThing(param: String): MyObject { ... }

Cannot yet work because Kotlin doesn't allow reference "MyClass::getSomeThing" in that form (It is both an extension function and a member function). Hopefully in M13, KT-8835 will be resolved allowing this.

@udalov
Copy link

udalov commented Aug 28, 2015

@apatrida FYI this won't be fixed in M13, probably some time later. You'll still be able to introspect such functions through the KClass API though

@apatrida
Copy link
Contributor Author

Ok thanks @udalov, so the user cannot "point" at the method via a reference, but we can still get to it from a variable holding a function (top example above), or by string name that is then found via KClass API. Maybe M14 :-) Thanks for commenting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants