Exposing Variable and Enforce Component Dependencies.

I want to expose a GameObject variable from a script. However, the GameObject passed into said script should contain a specific component.

Is there a way to enforce this at the Inspector interface or at compile time?

just make the exposed variable the type of the component that you want to enforce. That way, only gameobjects with that component attatched can be used. You can still access the gameobject the component is attatched to with the Component.gameObject reference