News for hackers. Stuff that matters.
Re:Rust is surprisingly expressive by saryant on Saturday December 28, 2013 @10:47PM (#6978235)
This is essentially a Scala "self-type".

  trait InterfaceA

  trait InterfaceB { self: InterfaceA => }

  class A extends InterfaceA // compiles

  class B extends InterfaceB // does not compile

  class B extends InterfaceA with InterfaceB // compiles
"self" isn't a keyword, you can call it whatever you like.
Re:Rust is surprisingly expressive by com2kid on Saturday December 28, 2013 @11:12PM (#6978332)
Hah, now that is nice.

I forget what convoluted use case I wanted it for. I ended up solving it using composition instead (which is the right solution 99% of the time anyway. :) )

Still though, I love using interfaces as contracts, so I get frequently annoyed at how poorly my tools (limited to C++2003 right now) support doing such!