Skip to content

Using readonly property as target of ByRef #13403

@jrmoreno1

Description

@jrmoreno1

Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01590

Visual Basic 2015 00322-90150-04967-AA372
Microsoft Visual Basic 2015

Steps to Reproduce:
Compile

Dim nlDate As Date? = #1/01/2015#
If (Date.TryParse("07/04/2016", nlDate.Value)) Then
Console.WriteLine(nlDate)
End If

Expected Behavior:
Compiler error ('ReadOnly' Property cannot be the target of an assignment)
Actual Behavior:
Compiles, and when run the parse succeeds, but the nullable date is unchanged. Checked with VS 2013, and same behavior, so it's not a change due to Roslyn, but I do think it's an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions