-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersFeature RequestResolution-DuplicateThe described behavior is tracked in another issueThe described behavior is tracked in another issue
Milestone
Description
When refactoring a large codebase, you will occasionally get into situations when there will be a few days before you have resolved all errors, and many lines will need to be commented out just in order to make the source code compile so it can be tested.
My idea is to create a compiler switch -errors-as-warnings which would cause an output assembly to be generated regardless of warnings, with all instances of errors replaced with throw new CompilationErrorException(...). Example:
class C {
public static void Main() {
blah();
}
}
could be emitted as if the program was
class C {
public static void Main() {
throw new CompilationErrorsException("CS0103", "The name 'blah' does not exist in the current context");
}
}
I think this feature could potentially alleviate or even eliminate one of the biggest advantages dynamic languages might have over C#.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersFeature RequestResolution-DuplicateThe described behavior is tracked in another issueThe described behavior is tracked in another issue