Tag: 类型解析

C#generics方法解析失败,出现模糊的调用错误

假设我已经定义了两个不相关的类型和两个具有相同签名但不同类型filter的扩展方法: public class Foo {} public class Bar {} public static class FooExtensions { public static TFoo Frob(this TFoo foo) where TFoo : Foo { } public static TFoo Brob(this TFoo foo) where TFoo : Foo { } } public static class BarExtensions { public static TBar Frob(this TBar bar) where TBar : Bar { […]