87 votes14 comments · Azure DevOps (formerly Visual Studio Team Services) » Version Control (Git/TFVC) · Flag idea as inappropriate… · Admin →
65 votesVlad commented
It would be nice if var to type conversion was available as a quick action. My main reason to wish for that is a situation when I need to move var definition out of original scope, thus removing the implicit type information. Here is an example:
var a = this.Foo(); // type of 'a' is implied by Foo
If I need top refactor this code to expose 'a' outside of the current scope, in most cases I have to use explicit type definition:
a = this.Foo();
// use 'a' here...
It would be very nice if there was a quick way to convert 'var' into type.