dotnet/roslyn

VBC emitting extra console output on warning with " error:"

Open

#5.724 geöffnet am 6. Okt. 2015

Auf GitHub ansehen
 (14 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)C# (4.257 Forks)batch import
Area-CompilersBughelp wanted

Repository-Metriken

Stars
 (20.414 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)

Beschreibung

Couldn't find an existing issue for this one (but could've missed it).

Compile the following piece of VB code in VS2015 with the "Implicit Type; Object Assumed" option set to "Warning":

Module Module1

    Sub Main()

        ' Causes build to fail
        Dim sEvent = String.Concat(" Error:", "Whatever")
        ' Won't cause build to fail
        Dim sEvent2 = String.Concat(" Another: ", "Whatever")
    End Sub

End Module

Both variable declarations will trigger a BC42020 warning. However, when the compiler encounters the sEvent declaration, it will include the line in the compiler output right after the warning, because it has the text " Error:" (leading space makes a difference).

This causes MSBuild/VS2015 to think the build failed and generate an strange error entry in the Errors window, even though only warnings were emitted during the build.

Contributor Guide