Skip to content

Instantly share code, notes, and snippets.

@ogirardot
Last active December 12, 2015 00:28
Show Gist options
  • Save ogirardot/4683919 to your computer and use it in GitHub Desktop.
Save ogirardot/4683919 to your computer and use it in GitHub Desktop.
Simple gist to show problem when using companion object extending trait and sub-class using the same trait
object MyApp extends App {
val b = new B()
}
trait Conflictor {
val log = "reduction"
}
class A {}
object A extends Conflictor {}
class B extends A with Conflictor {}
@ahoy-jon
Copy link

This one works :

object MyApp extends App {
  val b = new B()
}

trait Conflictor {
    val log = "reduction"
}

class A extends Conflictor {}

object A extends Conflictor {}

class B extends A with Conflictor {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment