Make `define-type` work at top-level

Closes PR 12913