[588] Cannot Introduce Field, Variable or Parameter

using System;

namespace StringTest
{
internal class Test2
{
private void Foo() {

}
}
internal class Test1
{
public Test1() {
bar = new Test2();
}
}
}

Go with the Cursor to bar and Press StrgShiftR (Refactor This), choose
Introduce Field, Variable or Parameter

you get this

-


Cannot Perform Introduce Variable
-


Cannot perform refactoring. Expression has unknown type.
-


OK
-



4 comments
Comment actions Permalink

Select "new Test2()" and then try to do it...

"Albert Weinert" <newsh2-06@der-albert.com> wrote in message
news:fllu6r$r4j$1@is.intellij.net...

using System;

>

namespace StringTest
{
internal class Test2
{
private void Foo() {

>

}
}
internal class Test1
{
public Test1() {
bar = new Test2();
}
}
}

>

Go with the Cursor to bar and Press StrgShiftR (Refactor This), choose
Introduce Field, Variable or Parameter

>

you get this

>

---------------------------
Cannot Perform Introduce Variable
---------------------------
Cannot perform refactoring. Expression has unknown type.
---------------------------
OK
---------------------------


0
Comment actions Permalink

Paul Bradshaw schrieb:

Select "new Test2()" and then try to do it...


It works in earlier Versions.

Regards

Albert

0
Comment actions Permalink

Hi Albert,

what about Alt-Enter for a quick-fix?


Regards,
Stefan Lieser

Albert Weinert schrieb:

using System;

namespace StringTest
{
internal class Test2
{
private void Foo() {

}
}
internal class Test1
{
public Test1() {
bar = new Test2();
}
}
}

Go with the Cursor to bar and Press StrgShiftR (Refactor This), choose
Introduce Field, Variable or Parameter

you get this

---------------------------
Cannot Perform Introduce Variable
---------------------------
Cannot perform refactoring. Expression has unknown type.
---------------------------
OK
---------------------------

0
Comment actions Permalink

Hi Stefan,

what about Alt-Enter for a quick-fix?


Works. But the Refactor This way works in earlier Version. Quick-Fixes
are only possible if you enable Code Analsis, which is a bad idea for
C#3.0 :)

Regards

Albert


0

Please sign in to leave a comment.