Moq4: 4.7.137 regression

Created on 4 Oct 2017  Â·  9Comments  Â·  Source: moq/moq4

After upgrading to Moq 4.7.137 the following scenario breaks:

```c#
public void Main()
{
new Mock().Object;
}

public interface IBreak
{
void DoStuff(Implementation1 a);
void DoStuff(Implementation2 a);
}

public abstract class BaseType
{
}

public class Implementation1 : BaseType
{
}

public class Implementation2 : BaseType
{
}
```

bug dynamicproxy

All 9 comments

Thanks for reporting. This looks like a valid usage scenario, I can't see a reason why this shouldn't work.

It appears to be caused by some change inside Castle Core 4.2.0. I'll do some investigation and see what I can find.

@cbruun, most of the work to get this fixed will have to happen over at castleproject/Core now.

In the meantime, if you could spare some time & would like to contribute to Moq, please feel free to submit a PR (against the develop branch) that adds your above repro code as a skipped unit test there, in UnitTests/Regressions/IssueReportsFixture.cs. For example:

#region 469

public class Issue469
{
    [Fact(Skip = "Temporarily disabled due to a regression in Castle Core, see https://github.com/castleproject/Core/issues/309.")]
    …
}

#endregion

P.S.: BaseType<T> isn't actually needed to reproduce the problem.

@stakx, @cbruun and I worked on the issue together when he reported the regression, so I have taken the liberty to write the test and make the pull request.

I just now saw that you mention BaseType<T> isn't actually needed. Feel free to remove it from the PR.

@ADThomsen, thanks for letting me know. Will merge your PR in a short while.

This version along with Castle.Core 4.2.0 definitely breaks us. Will be stock with the previous version, i'll give it a try on the next release.

I was not able to pinpoint the issue, other than noticing test get hanged indefinitely.

@ivancitin: Can you please post repro code of such a test that hangs as a separate issue? Could be a different problem than the one reported here.

I'm preparing a "hotfix" version of Moq (4.7.x) which should be available in the next 24 hours or so.

@cbruun and @ADThomsen: Moq 4.7.142 is now available. Once you update (which should automatically update its dependency Castle Core to 4.2.1, which is the important bit), you should be good.

@stakx Thanks for the update. We have upgraded Moq and can confirm that our tests again work as expected.

Was this page helpful?
0 / 5 - 0 ratings