$pattern must be scalar but $type makes sense here