dotnet/roslyn

Poor error message when calling a member of a newly constructed object in VB

Aperta

#38.308 aperta il 27 ago 2019

 (1 commento) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-CompilersBugConcept-Diagnostic ClarityLanguage-VBhelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

Version Used: master Steps to Reproduce:

compile the following code:

Public Module Program
    Public Sub Main()
        New string("").Clone()
    End Sub
End Module

Expected Behavior:

A useful error message, explaining that you need to use Call New string("").Clone()

Actual Behavior:

error BC30035: Syntax error.

Guida contributor