Errors are typically a bad thing in computer programming. They are called bugs and are caused by an incorrect program. However, one kind of error, a compile-time error, is different because it forces you to improve the quality of your software before it ever causes trouble in the world.
This C# article describes compile-time errors. These errors are helpful.

Programmers are human beings and they make mistakes in their code. Sometimes these mistakes are simple typos and sometimes they are caused by a misunderstanding of the language. Even the best programmers make errors; this is not something you can avoid.
Some languages are not compiled. With programs in these languages, you can actually run a program that has syntax or other errors in it. An error might only be found in a specific case that occurs while it is running. This means that a program with errors can escape notice and be deployed in an important situation.

In languages that are compiled, like C#, the compiler will validate the program in many ways. It will only accept programs that have the correct syntax. Programs must use the object model correctly. Every method must exist.
With compile-time errors, if a program is not essentially correct, it cannot be compiled. Thus, no program with serious errors can be deployed. If a program compiles correctly, it is guaranteed to be correct at least in a basic way.
Compile-time errors greatly improve the quality of software. They make it so that code that has serious errors in it will never actually be allowed to execute. This reduces the possibility that a program that is wrong will be used in an important project. Compile-time errors, in addition to performance, are a key benefit of compiled languages.
Compiler Explanation