fix an error when scanning an AST containing an anonymous class