Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードはコンパイルを拒否します。
Nullable!(Nullable!int) nni = Nullable!(Nullable!int)(10);
次のエラー メッセージが表示されます。
Error: inout method nullable.Nullable!(Nullable!(immutable(int))).Nullable.this is not callable using a mutable object
なんで?
悪いエラーメッセージのようです。
のコンストラクタへの引数Nullable!(T)は ですT。この場合、TはNullable!intですが、 を渡していますint。intnullable でラップする必要があります。
Nullable!(T)
T
Nullable!int
int
Nullable!(Nullable!int) foo = Nullable!(Nullable!int)(Nullable!int(10));