scala - Implicits from subclass -


i trying implement template method pattern implicits. class top class 2 extensions.

class defining template pattern , has method dosomething(). method uses several implicits inside. class abstract.

class b , class c extending class a, providing implicits in scope, implementing other abstract methods , no more abstract.

example (using spray's pipeline):

a:  abstract class a[t <: : manifest] {     ....      abstract def method: partialfunction[t,unit] //not interesting      def dosomething() {          //method using implicit parser httpresponse -> t          val responsefuture: future[t] = pipeline(get(url))          responsefuture.onsuccess(method)     } }   b:  import caseclassb._ //importing implicits transfer httpresponse -> caseclassb class b extends a[caseclassb] {     def method: partialfunction[caseclassb,unit] = {//not interesting} } 

this setting not work (compilation of class fails because of "could not find implicit value evidence parameter"). there better way how overcome problem without need have "implicit abstract def" in class need overriden? reason don't class b , class c providing implicits using imports.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -