Remove static check on contract generation.

Closes PR 13607.
Closes PR 13191.