Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
erik-kallen opened this issue Feb 8, 2015 · 2 comments
Closed
Assignees
Labels
Area-Compilers Feature Request Resolution-Duplicate The described behavior is tracked in another issue
Milestone

Comments

@erik-kallen
Copy link

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)

@gafter gafter self-assigned this Feb 9, 2015
@gafter gafter added this to the 1.2 milestone Feb 12, 2015
@gafter gafter modified the milestones: 2.0, 1.2 Aug 16, 2015
@gafter
Copy link
Member

gafter commented Oct 17, 2015

This is particularly useful for generating a reference assembly when there are errors in the sources. It allows more efficient cross-project builds in the IDE, and it supports producing reference assemblies from "skeleton" source.

@gafter gafter modified the milestones: 1.2, 2.0 Oct 17, 2015
@jaredpar
Copy link
Member

Thank you for reporting this issue. It does look like a duplicate of the reference assembly proposal. Letting that be the main tracking issue going forward.

#2184

@jaredpar jaredpar added the Resolution-Duplicate The described behavior is tracked in another issue label Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature Request Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

3 participants