question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"to" method of Guice builder

See original GitHub issue

I import Guice like this:

native("jvm")
module guicy "1.0.0" {
    import "com.google.inject:guice" "4.0";
    import ceylon.interop.java "1.2.0";
}

I have this code to configure Guice:

import ceylon.interop.java {
    javaClass
}

import com.google.inject {
    inject,
    AbstractModule
}

interface Bar {}

class BarImpl() satisfies Bar {}

inject class Foo(Bar bar) {

}

object fooBarModule extends AbstractModule() {

    shared actual void configure() {
        bind(javaClass<Bar>()).to(javaClass<BarImpl>());
    }

}

I get an error that this is no to() method for AnnotatedBindingBuilder.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
FroMagecommented, Jul 20, 2016

Expletive!

0reactions
gavinkingcommented, Aug 24, 2016

Actually this now compiles without error without overrides 😃

Why so it does 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guice injection with Builder pattern for client lib - Stack Overflow
Guice operates at runtime, so it's essential that we see your main method to see what your application code actually does.
Read more >
Guide to Google Guice - Baeldung
A quick, practical guide to dependency injection in Google Guice. ... This main method retrieves an instance of our Communication class.
Read more >
java.lang.Object play.inject.guice.GuiceBuilder<Self,Delegate>
Class GuiceBuilder<Self,Delegate extends play.api.inject.guice.GuiceBuilder<Delegate>> ... A builder for creating Guice-backed Play Injectors. Field ...
Read more >
FactoryModuleBuilder | Guice - Google
Provides a factory that combines the caller's arguments with injector-supplied values to construct objects. Defining a factory. Create an interface whose ...
Read more >
Feature Request Guice automatically builder pattern
I would like to use a builder (preferably auto-value) with Guice. Guice can find constructors annotated with @Inject but those can be cumbersome...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found