I'm having trouble making this approach work:

class Foo {
  int length;
  int bar;
}

class HasLength {
  int length;
}

dump("Foo has length: ${new Foo() is HasLength}");
> "Foo has length: false"