Just declare S explicitly in your method :
public class My<T, S>
{
public My(G<S> g, T t)
{
// code that DOES NOT use S in any way
}
}
This will compile (except if you have some conditions on S on G class). You will have to declare what is S in any case when using the My class.
Example will G< S > = Nullable< S > :
public class My<T, S> where S : struct
{
public My(Nullable<S> g, T t)
{
// code that DOES NOT use S in any way
}
}
With this implementation, you have to define S when using the My class (in that case S is int):
var myVar = new My<string, int>(4, string.Empty);