This is a migrated thread and some comments may be shown as answers.

Use explicitly typed local variable declaration

4 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason
Top achievements
Rank 1
Jason asked on 09 Oct 2013, 03:50 PM
This feature is used by coders to explicitely state the type of a particular variable.   All you need to do is type var myvar = fn(); hit the hotkey, and BAM!  var changes to the actual return type of fn().

According to the help files, this feature only works in C# (not VB).

That sucks.

Is there any intention to get that feature working with JustCode in VB?  The checkbox is there in options, but the feature always assumes it's an "Object" instead of it's actual type, which is almost always worse than just using the native VS type inference.  

By comparison, DevExpress had that feature pretty early in their suite and I enjoyed it thoroughly.

Thanks,

Jason


4 Answers, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 10 Oct 2013, 09:11 AM
Hi Jason,

 Thanks for contacting us.
I just tested this feature in VB with the latest JustCode internal build version and it seems that it is working fine. I will fix this misleading information in the documentation.
Please update your JustCode and give it a try. If you find that it returns an object instead of the right type please send us a sample project or a code snippet so we could investigate.
Thank you.

Regards,
Zdravko
Telerik
Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
0
Jason
Top achievements
Rank 1
answered on 10 Oct 2013, 11:54 AM
I'm still getting it even after upgrading to the latest version:

Q3 2013 Internal Build (2013.3.1004.2)

Module Module1
    Sub Main()
        'when I select "use explicitly typed local variable declaration" on the next line, it wrongfully infers that it should be an object
        Dim response = proof()
    End Sub
    Function proof() As Int32
        Return 1
    End Function
End Module

I'm running VS 2010 10.0.40219.1 SP1Rel if that makes a difference, though I've confirmed that the problem also exists in VS 2012 (I have both installed).

I also verified that this DOES work with C# on my machine...  But unfortunately the project that I'm currently working on is in VB so that knowledge grants me little solace.
0
Zdravko
Telerik team
answered on 11 Oct 2013, 12:35 PM
Hi Jason,

 Thanks for the code snippet.
I used it in my demo, but everything is as expected.
I already wrote to you at your other ticket to send us a sample project if possible.
Thank you.

Regards,
Zdravko
Telerik
Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
0
Jason
Top achievements
Rank 1
answered on 11 Oct 2013, 06:14 PM
The problem was caused by the fact that I had Option Infer turned off.   The feature requires Option Infer to be enabled.

Thanks for your help, Zdravko and "Telerik Admin". :-)
Tags
General Discussions
Asked by
Jason
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Jason
Top achievements
Rank 1
Share this question
or