ジェネリックが・・・
public class HogeHoge<S> : IHogeHoge<S> where S : IHogeHoge<S> { private int aaa; public S Hoge(int aaa) { this.aaa = aaa; return (S) this; } }
このソースをビルドすると「return (S) this」のところが「型 HogeHoge<S> を型 S に変換できません。」とうエラーになってしまいます。
Javaで書くとこんな感じでビルドが通るのです。
public class HogeHoge<S extends IHogeHoge<S>> implements IHogeHoge<S> { private int aaa; public S Hoge(int aaa) { this.aaa = aaa; return (S) this; } }