[ts 4.7] Support extends
constraints for infer
#14476
Merged
extends
constraints for infer
#14476