Hi Martin,
From the most recent message of Andrei, I assumed that it's not the
actual inheritance scenario that is important, but rather the desire
to satisfy multiple similar contracts. This scenario can be achieved
with macro types as described by Andrei (btw, mixing in macro types is
one of the points that I wanted to discuss with you upon my return to
Lausanne).
However, macro types are, of course, not real types, so they won't be
available, say, as type constructors. That is, it won't be possible to
write Binder[_] or to pass Binder to some place that wants a type
constructor. The best one can do is to write "type RunnableBinder =
Binder("runnable", classOf[Runnable]); type CallableBinder =
Binder("callable", classOf[Callable])" and then use the generated
types, but nothing more.
@Andrei Long story short, macros provide a workaround for your
scenario. It will be possible to write code that is similar to what
you've written, and it will work, but that won't give you full
integration with the type system. Sorry if I misunderstood your intent
in my previous answer.
All the best,
Eugene
On Oct 30, 10:59 pm, martin odersky <
martin.oder...@epfl.ch> wrote:
> Prof., EPFL <
http://www.epfl.ch> and Chairman, Typesafe<
http://www.typesafe.com>