History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-51769
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Sergey Shkredov
Reporter: Serge Baltic
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

IntroVar::VB: Should Remove the Original Expression When Just Creating a Declaration

Created: 24 Oct 07 15:20   Updated: 26 Oct 07 17:29
Component/s: None
Fix Version/s: 4.0, 3.1
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
In C#, we would sometimes declare a local variable by writing the expression first, then intorducing a local var out of it.
This way it gets its type automatically, and sometimes the proper name also.

When the var is introduced, the original expression is removed.

In VB, however, it is not. But it (1) should work as in C#, otherwise create-from-usage patterns are broken, and (2) it is a compilation error in most of the cases. Example:

Dim a As Integer = 1
a * Math.PI / 8

->

Dim a As Integer = 1
Dim angle As Double = a * Math.PI / 8
angle()

-> "Expression is not a method".



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.