typed: prevent TYPED: definitions without types.
typed: Add unit test for #778.