Regession bug:嵌套类不能与直接封闭的类具有相同的名称 [英] Regession bug: a nested class cannot have the same name as the immediately enclosing class

查看:180
本文介绍了Regession bug:嵌套类不能与直接封闭的类具有相同的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译以下代码,然后使用重写器

Compiling the following code followed by using the rewriter


namespace ClassLibrary3
{
  public static class Class1<T> where T : class
  {
    public static void Test(string name)
    {      
    }
    
    internal static T GetDuplexInstance(InstanceContext context)
    {      
      Contract.Requires<ArgumentNullException>(context != null);      

      return CreateGenericInstance(
        delegate(string localConfigName) { return CreateDuplexFactory(context, localConfigName); },
        delegate(NetTcpBinding binding, EndpointAddress e) { return CreateDuplexFactory(context, binding, e); });
    }
    
    private static ChannelFactory<T> CreateDuplexFactory(InstanceContext context, NetTcpBinding binding, EndpointAddress e)
    {
      return new DuplexChannelFactory<T>(context, binding, e);
    }

    private static ChannelFactory<T> CreateDuplexFactory(InstanceContext context, string configName)
    {
      return new DuplexChannelFactory<T>(context, configName);
    }

    private static T CreateGenericInstance(
      Func<string, ChannelFactory<T>> configChannelDelegate,
      Func<NetTcpBinding, EndpointAddress, ChannelFactory<T>> directChannelDelegate)
    {
      Contract.Requires<ArgumentNullException>(configChannelDelegate != null);
      Contract.Requires<ArgumentNullException>(directChannelDelegate != null);

      return null;
    }
  }
}

推荐答案

我试过转到文件dropper URL,但它似乎不起作用。我需要一个帐户来检索样本吗?如果您可以将其放入zip文件并将其发送到 我,那会很棒。如果你在GetDuplexInstance
中摆脱了匿名代表问题会消失吗?我猜测我们的关闭重复是罪魁祸首。
I tried to go to the file dropper URL, but it didn't seem to work. Do I need an account there to retrieve the sample? If you can just put it into a zip file and send it to  me, that would be great. If you get rid of anonymous delegates in GetDuplexInstance does the problem go away? I'm guessing our closure duplication is to blame.


这篇关于Regession bug:嵌套类不能与直接封闭的类具有相同的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆