Skip to content

Proposal: Create the output assembly when there are compilation errors #305

@erik-kallen

Description

@erik-kallen

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#.

(from http://roslyn.codeplex.com/discussions/573979)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions