class Test
{
public BinaryWriter Content { get; private set; }
public Test Write<T> (T data)
{
Content.Write(data);
return this;
}
}
它无法编译。
1. The best overloaded method match for 'System.IO.BinaryWriter.Write(bool)' has some invalid arguments
2. Argument 1: cannot convert from 'T' to 'bool'
看起来 Test.Write 总是试图调用 BinaryWriter.Write(bool)。有什么建议吗?