In my application I have components that are linked to eachother using inputs and outputs. The data which will be exchanged can be of any type, so I use generics.

```
public interface IInputVariable<T>
{
    IOutputVariable<T> Source { get; set; }
}

public interface IOutputVariable<T>
{
    T Value { get; set; }
}

```

In another class, the Components are linked together. Which components are linked, are derived from a file. The class which does the linking has no knowledge about which type the input and output exchange. This class only wants to connect them with the following code:

```
IOutputVariable<double> output;
Type argumentType = output.GetType().GetGenericArguments()[0];
IInputVariable<argumentType> input = new BasicInputVariable<argumentType>();
input.Source = output;

```

This code doesn't compile because argumentType can not be used as an generic argument. Is there a correct way to formulate this? Or is it possible to declare a generic variable without knowing its argument type?