You can split t into a generic method on a generic type:
class Foo<TOuter> {
public static void Bar<TInner>(TInner arg) {...}
}
...
int x = 1;
Foo<string>.Bar(x);
Here the int is inferred but the string is explicit.
More Related Contents:
- How to capture value OOPS & Generic [closed]
- Create Generic method constraining T to an Enum
- Why can’t the C# constructor infer type?
- Can’t operator == be applied to generic types in C#?
- Generic Method Executed with a runtime type [duplicate]
- Null or default comparison of generic argument in C#
- Combination of List
- c# covariant return types utilizing generics
- Passing a single item as IEnumerable
- Static Generic Class as Dictionary
- Converting a generic list to a CSV string
- Get a generic method without using GetMethods
- Using IsAssignableFrom with ‘open’ generic types
- A reusable pattern to convert event into task
- Sorting an IList in C#
- c# compare two generic values [duplicate]
- Accessing a property of derived class from the base class in C#
- Get all types implementing specific open generic type
- Parse string to enum type
- Calling generic method with Type variable [duplicate]
- Case insensitive access for generic dictionary
- Ambiguous call between two C# extension generic methods one where T:class and other where T:struct
- How do I tell if a type is a “simple” type? i.e. holds a single value
- How to define generic type limit to primitive types?
- Entity Framework – how do I get the columns?
- How can I write a generic anonymous method?
- The component does not have a resource identified by the uri
- C# generic methods, type parameters in new() constructor constraint
- How does Java’s use-site variance compare to C#’s declaration site variance?
- Convert DataTable to Generic List in C#