#1962 Why my mixin is not compiled?

Akcelisto Thu 19 Jul 2012

using concurrent

class Tree{}
class AdvancedTree:Tree{}

mixin HasTree{
  virtual Tree tree(){
    Actor.locals["tree"]
  }
}

mixin HasAdvancedTree : HasTree{
  override AdvancedTree tree(){
    super.tree
  }
}

Compiler output:

Test.fan(15,11): Unknown slot 'sys::Obj.tree'

SlimerDude Thu 19 Jul 2012

I guess because you don't inherit from Mixins, so super.tree() doesn't exist in Obj.

brian Thu 19 Jul 2012

super.foo means in my superclass, you can use named mixin like Tree.super.tree

Login or Signup to reply.