[Compiler-v2] Add ability check on number constraint (#15346)