• T
    Remove Warning as Error/Warning treated as error. · dcbb948a
    tmeschter 提交于
    There are a number of design and implementation issues with the "Warning as Error" and "Warning treated as error" prefixes shown on C# and VB warnings that have been promoted to errors:
    
    1.) The prefix is redundant. The command line already prefixes the issue with "error" if it is being treated as an error, and so the additional prefix is not needed. For example:
    
    Before:
             error CS0168: Warning as Error: The variable 'x' is declared but never used
    After
             error CS0168: The variable 'x' is declared but never used
    
    Inside VS, the Error List icons display the same information.
    
    2.) The prefix redirects the user's focus from the issue itself to the fact that is has been promoted from an warning to an error. It is more noise than help.
    
    3.) The VB implementation is just weird.
    
    C# simply adds the prefix to the message and leaves everything else alone.
    
    VB, however, outputs two errors when treating a warning as an error. One is the original issue with the original error code and message, just as an error. The second is an error with a special "Warning treated as error" error and the prefixed message. However, this extra error is only issued once for a group of issues, even if multiple issues in that group should be promoted to errors.
    
    4.) C# and VB have completely different implementations for the same feature. In VB, the core compiler layer handles adding the prefix and generating the second error. In C#, each compiler host (csc.exe, vbcscompiler.exe, VS, etc.) is responsible for adding the prefix to the message. This makes it difficult for other compiler hosts to report errors the same way csc.exe/vbc.exe do, and difficult to merge errors from multiple sources (such as happens when running a build from within VS).
    
    After some discussion, it was decided that the low (or non-existent) value provided by this "feature" did not warrant the implementation complexity, and it should be removed. (changeset 1337219)
    dcbb948a
ParseDirectives.vb 152.0 KB