type-inference

The type arguments for method cannot be inferred from the usage.

Maybe I'm overworked, but this isn't compiling (CS0411). Why? interface ISignatur<T> { Type Type { get; } } interface IAccess<S, T> where S : ISignatur<T> { S Signature { get; } T Value { get; set; } } class Signatur : ISignatur<bool> { public Type Type { get { return typeof(bool); } } } class Serv...

Generics: Why can't the compiler infer the type arguments in this case?

I wanted to write an extension-method that would work on dictionaries whose values were some sort of sequence. Unfortunately, the compiler can't seem to infer the generic arguments from my usage of the method; I need to specify them explicitly. public static void SomeMethod<TKey, TUnderlyingValue, TValue> (this IDictionary<TKey, TVa...

Getting Proper Type Inference for a more complicated type in a Generic Method

First off I am working in the .NET 2.0 framework Second I have this working just want it working a little more elegantly Now to the issue on hand I have a need to effectively "mirror" a Dictionary object such that if we start with an object like this Dictionary<TKey,TValue> StartDictionary; We can Mirror it like this Dictionary<TV...