Skip to content

Duplicate Binding: ScalaModule believes A == A with B. #43

@nbauernfeind

Description

@nbauernfeind

@shengc Provided an example that involves a binding error when it probably shouldn't be.

trait A { def a {} }
trait B

type AB = A with B

class Model extends AbstractModule with ScalaModule {
    def configure() {
        bind[A].toInstance(new A {})
        bind[AB].toInstance(new A with B {})
    }
}

Guice.createInjector(new Model()) // This fails at run time. Guice thinks binds are dups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions