#2153 Facet value is not serializable

SlimerDude Fri 31 May 2013

I was surprised I'm not able to use constants as facet values:

const mixin Chicken {
  static const Str feet := "x3"
}

facet class PigTail {
  const Str id
}

@PigTail { id=Chicken.feet}
class DonkeyEar { }  // COMPILATION ERROR

Facet value is not serializable: Wotever::PigTail (field not serializable)

Is this by design? The error message sounds a bit cryptic if it is.

brian Fri 31 May 2013

The error message may be greatest, but what is telling you is that facet values have to be some expression that directly maps to serialization syntax. Right now field accesses are not considered serializable.

Login or Signup to reply.