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

Default parameters not supported? #42

Open
mkotsbak opened this issue Sep 25, 2015 · 3 comments
Open

Default parameters not supported? #42

mkotsbak opened this issue Sep 25, 2015 · 3 comments

Comments

@mkotsbak
Copy link

When I try interfaces like this:

trait Protocol {
val dictionary: protocol.Dictionary
val userRegistry: protocol.UserRegistry
}

trait UserRegistry {
def createUser(newUser: User): User
def lookupFirstNamePart(firstname: String, exact: Boolean = false): Seq[User]
}

and an implementation like this:

override def lookupFirstNamePart(firstnamePart: String, exact: Boolean = false)

the compile fails at line:

val router = AutowireServer.routeProtocol

with error: "value lookupFirstNamePart$default$2 is not a member of io.widok.server.Controllers"

Am I doing something wrong, or is the macro magic missing support for default values?

@tindzk
Copy link
Contributor

tindzk commented Sep 25, 2015

I believe this is due to the default argument.

@mkotsbak
Copy link
Author

Yes, me too, but there is no technical reasons it could not be supported? The default value should be inserted at server side, in case of not using Autowire on client side (third party client emulating the interface).

@mkotsbak
Copy link
Author

Strangely I found this comment in the code indicating that it should have worked:

   * @param args Serialized arguments for the method that was called. Kept
   *             as a Map of arg-name -> serialized value. Values which
   *             exactly match the default value are omitted, and are
   *             simply re-constituted by the receiver.

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

No branches or pull requests

2 participants