Roslyn: FatalExecutionEngineError when renaming type parameter

Created on 31 Jan 2018  路  7Comments  路  Source: dotnet/roslyn

Version Used: VS 15.5.6

Steps to Reproduce:

Rename T1 (by clicking F2)

public interface IFoo<T1, T2> // Rename T1
{
    IEnumerable<T1> Bar(T2 value);
}

public class Foo<T1, T2> : IFoo<T1, T2>
{
    public IEnumerable<T1> Bar(T2 value)
    {
        return Bar(value);
    }
}

Stack Trace:

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Microsoft.CodeAnalysis.Workspaces
  StackTrace:
   at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.Session.<FindDocumentsAndPossibleNameConflicts>d__24.MoveNext()

Also when I try to find all references for Bar Visual Studio shows no references.

Area-IDE Bug Developer Community Need More Info help wanted

All 7 comments

also reported at link link

Is there a temporary workaround until a fix is implemented? Seeing as this issue has been open for 6 months, I suppose it'll still be a while before it's fixed.

Anytime I hit Alt+Enter in a delegate body Visual Studio crashes. This is extremely annoying, the only option currently would be to stop using Quick Edits (Alt+Enter) entirely.

@JosefPihrt I tried the given sample in the latest preview 5.0 and it does not crash, T1 is renamed to T3 correctly.
Here are my repro steps, please let me know if I missed any steps. Thanks

1) open the solution
2) double click to select T1 in IFoo
3) Click F2, which brings up the rename dialog
4) Enter 'T3', then click Apply button
5) rename finishes successfully

public interface IFoo<T3, T2> // Rename T1
{
    IEnumerable<T3> Bar(T2 value);
}

public class Foo<T1, T2> : IFoo<T1, T2>
{
    public IEnumerable<T1> Bar(T2 value)
    {
        return Bar(value);
    }
}

@EnCey I was trying out your sample from vsfeedback, and I still cannot repro it on the latest preview 5.0. Could you try the latest version and let me know the exact repro steps if you run into it again? Thanks!

image

@JieCarolHu I confirm that I can successfully rename T1 in VS 15.7.5.

Hi @JieCarolHu , I just updated to 15.8 and VS no longer crashes, the issue seems to be resolved.

Providing more detailed steps would have been difficult, since I'd essentially have to give you the entire project. My sample on vsfeedback is a replica of where the issue occurs, only that it doesn't occur there. Must have been something in the delegate body, or the class surrounding it, but it would be a lot of work to extract that (lots and lots of interfaces connected to each other).

Thanks for the confirmation. closing this issue

Was this page helpful?
0 / 5 - 0 ratings