class Foo {} var foo = Foo(); var field = 23; print(hasattr(foo, field)); # expect runtime error: `hasattr` can only index with string indexes, got: `23` (instance: ``)