You might be surprised to learn that this is not only possible but something research is definitely working towards.
In a language like Agda, for example, when there is enough type information available the compiler can fill in the holes for you with the obviously correct implementation.
The idea behind program synthesis drives this even further. Using type level specifications we can automatically derive the programs that meet those specifications. This is useful because the language of types is much more concise than the language of terms. For sufficiently difficult problems it's much easier for humans to reason about complexity in higher-level specifications. Let the computer generate the code!
It's still early on for this kind of technology but projects like Synquid[0] are making good headway.
Dependent-type theory also forms the basis of interactive theorem proving in Coq and Lean[1]. We use something like holes as the basis of proofs. Haskell's typed holes are quite a bit more loose but to me it feels very similar to working with such a system. I propose to Haskell there there exists an expression that satisfies a particular type and then I use the typed holes to fill in my obligations to provide a proof. The hole is my goal and the available objects in scope are my terms. It is a very effective tool for solving hard problems.
[0] https://www.csail.mit.edu/research/synquid-synthesis-liquid-...
[1] https://leanprover.github.io/
update: Links