-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Milestone
Description
Ported from TFS WorkItem: 1113223
Repro Steps:
Add the following code to the end of the declaration of CompilationContext (i.e. inside the class) in Closed\ExpressionEvaluator\VisualBasic\Source\ExpressionCompiler\CompilationContext.vb
Friend Shared Sub Test(arg As Object)
Dim identity = If(TryCast(arg, B)?.A, TryCast(arg, A))
End Sub
Class A
End Class
Class B
Public ReadOnly Property A As A
End Class
Expected: No offer to remove cast
Actual: Offers to remove this cast.
Revisions:
- Created By Andrew Casey (ROSLYN) (1/22/2015 6:18:10 PM)
For some reason, I have been able to repro this in a standalone project, but none of the types are roslyn types.
I'm guessing it's related to the conditional access operator.
Reactions are currently unavailable