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

auto typeof() feature request

1 Answer 25 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.
MiddleTommy
Top achievements
Rank 1
MiddleTommy asked on 30 Apr 2011, 02:51 PM
It would be nice to have a way for JustCode to automatically translate a type into a typeof();

if you are calling a method with a type for a parameter.
ie
public void RegisterType(Type type){...}

then in your code you type

...
RegisterType(string);
...

Justcode could automatically change that to

RegisterType(typeof(string));

provided it also checks for variable names that are not the same name as the type. If So offer a refactoring to change it to typeof...

What do you think?



1 Answer, 1 is accepted

Sort by
0
Svetlozar
Telerik team
answered on 09 May 2011, 07:54 AM
Hello MiddleTommy,

Thank you for your feedback.

The way our analysis is built makes it hard to create a reasonable error + quick fix for RegisterType(string);, because we currently don't recover the keyword "string" to an expression(and therefore to an argument of wrong type).

We will consider changing the recovery in the future to create a refactoring for that

Kind regards,
Svetlozar Angelov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
MiddleTommy
Top achievements
Rank 1
Answers by
Svetlozar
Telerik team
Share this question
or