Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
trait Page
trait PageData
trait PageOperation {
type P <: Page
trait PageComponent {
self: PageOperation =>
protected var page:P = _
protected var pageData:PageData = _
def initialise(page0:P, pageData0:PageData) {
page = page0
pageData = pageData0
trait AhoyPageOperation extends PageOperation {
type P = AhoyPage
class AhoyPage extends Page
object MyPageComponent extends PageComponent with AhoyPageOperation {}
trait PageInfo {
self: PageOperation =>
def page : P
trait AhoyPageInfo extends PageInfo with AhoyPageOperation {
def page = new AhoyPage // for the example
object MyApp extends App {
MyPageComponent.initialise(new AhoyPage, new PageData {})
MyPageComponent.initialise(new MyPageComponent.P, new PageData {})
MyPageComponent.initialise((new AhoyPageInfo {}).page , new PageData{})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.