Skip to content

cannot bind or create instance of scalaz reader (due to miss of Manifest) #42

@shengc

Description

@shengc

import com.google.inject._
import net.codingwell.scalaguice._

import scalaz.Reader

class AModule extends AbstractModule with ScalaModule {
def configure() {
bind[Reader[Int, Int]].toInstance(Reader { (_: Int) * 2 })
}
}

gives me error: "Manifest of Reader[Int, Int] is not found"

so I have to resort to the legacy way of creating guice module

class AnotherModule extends AbstractModule {
def configure() {
bind(classOf[Reader[Int, Int]]).toInstance(Reader { (_: Int) * 2 })
}
}

but then when I tried to create instance using scalaguice, got the same error again

val injector = Guice.createInjector(new AnotherModule())

injector.instance[Reader[Int, Int]] // same error as above

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions