40

我想知道为什么我不能在谷歌上得到这样简单的东西。此代码不可编译。我怎样才能做到这一点?

public class TestStep<StartEvent, CompletedEvent> 
    where StartEvent : MyBase1, MyInterface1, new() &&
    where CompletedEvent : MyBase2, MyInterface2, new()
{
}

请帮忙。

4

1 回答 1

69

尝试不使用“&&”

public class TestStep<StartEvent, CompletedEvent> 
    where StartEvent : MyBase1, MyInterface1, new()
    where CompletedEvent : MyBase2, MyInterface2, new()
{
}
于 2012-11-08T09:19:04.973 回答