#1045 Compiler check error for LoadMixinInstance

Akcelisto Sun 28 Mar 2010

class A : State{
  override Str:Obj prms := Str:Obj[:]{
    get{
      *prms.ro
    }
  }
}

mixin State{
  abstract Str:Obj prms

  Void set(Str key, Obj obj){
    *prms[key]=obj
  }

  Int? getInt(Str key){
    prms[key] as Int
  }
}

Compiler say:

A.fan(13,7): LoadMixinInstance

What is mean LoadMixinInstance?

How to write: prms in A is RO and State can mutate prms?

qualidafial Sun 28 Mar 2010

The State mixin is trying to access the prms field storage directly, but there is no storage at the mixin level because the field is abstract. You have to move the set method to class A.

Akcelisto Sun 28 Mar 2010

OK. Why compiler message is so strange?

brian Sun 28 Mar 2010

Promoted to ticket #1045 and assigned to brian

That error is just a sanity check in CodeAsm.

We really need to do a proper check and error report in CheckErrors for attemping to use storage operator in a mixin.

brian Sun 28 Mar 2010

Renamed from LoadMixinInstance? to Compiler check error for LoadMixinInstance

brian Mon 29 Mar 2010

Ticket resolved in 1.0.53

Added check to report use of storage operator in mixin as an error.

Login or Signup to reply.