dotnet/roslyn

Message for BC30560 should include what assemblies the ambiguous types come from

Open

#10.811 geöffnet am 23. Apr. 2016

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (4.257 Forks)batch import
Area-CompilersBugConcept-Diagnostic Clarityhelp wanted

Repository-Metriken

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

Beschreibung

Create two projects with the same type name N.Class1 by compiling the following into two different libraries:

Namespace Global.N
    Public Class Class1
    End Class
End Namespace

Then reference them both and refer to the

Imports N

Module Module1
    Sub Main()
        Dim c As New Class1
    End Sub
End Module

Result: The error message is error BC30560: 'Class1' is ambiguous in the namespace 'N'., which doesn't tell you anything about where the ambiguities come from so you can try to fix it.

Note: C# gives a much better error message: error CS0433: The type 'Class1' exists in both 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'ClassLibrary2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Contributor Guide