Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using "yield" with IEnumerables get error "System.InvalidProgramException : Common Language Runtime detected an invalid program." #88

Closed
DiegoSilvaFG opened this issue Apr 19, 2018 · 0 comments

Comments

@DiegoSilvaFG
Copy link

DiegoSilvaFG commented Apr 19, 2018

On my tests, if the tested method uses the keyword "yield" with IEnumerables it throws this exception:

Error Message:
 System.InvalidProgramException : Common Language Runtime detected an invalid program.
Stack Trace:
   at ServiceFramework.Persistence.LabelIndexHelper.<GeneratePairs>d__0.MoveNext()
...

MiniCover version: 2.0.0-ci-20180329054201

Method sample code:

public IEnumerable<string[]> GeneratePairs(string[] labels)
{
    if (labels == null || labels.Length == 0)
    {
        yield break;
    }

    for (var i = 0; i < labels.Length - 1; i++)
    {
        for (var j = i + 1; j < labels.Length; j++)
        {
            yield return new[] {labels[i], labels[j]};
        }
    }
}

The same code runs with no issues when using "dotnet test" line command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant