interface IOption { get(): A; flatten(): IOption; } class None implements IOption{ get(): T { throw null; } flatten() : IOption { return new None(); } }