EDIT: SOLUTION
DO NOT USE SUB-GENERICS! These may work one minute and in the next stop working
But if you need a sub-geneirc for the as Statement use this
ORIGINAL:
Hi,
I'm trying to make a function, that directly gives me a List<T> instead of the List<IMyFunctionalBlock>!
My first attempt:
[SOLVED] where Statement not working?
DO NOT USE SUB-GENERICS! These may work one minute and in the next stop working
But if you need a sub-geneirc for the as Statement use this
Code:
public void <T> foo()
where T : class
{
[...]
}
ORIGINAL:
Hi,
I'm trying to make a function, that directly gives me a List<T> instead of the List<IMyFunctionalBlock>!
My first attempt:
Code:
public List<T> getAllBlocksOfType<T>()
where T : IMyTerminalBlock
{
List<IMyTerminalBlock> b = new...