We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null 許容参照型4ページ目のアノテーション属性の利用例の中にあるAllowNull属性の例が実際と異なっているようです。
記載されている説明では、
TextWriter.NewLine は get で null を返すことはありません。 しかし、「null を set すると Environment.NewLine を使う」という仕様があって、set だけが null 許容です。 そこで、以下のように、set にだけ AllowNull が付いています。
となっていますが、.NET Source Browserで見ることできる現状のコードではAllowNull属性はsetではなくプロパティ側についていました。
現在のAllowNull属性の定義ではAttributeTargetsにMethodが含まれていないため、setだけにAllowNull属性を指定すること自体ができないはずです。preview段階のソースなどを参考にした例がそのまま残ったりしてしまっているのではないでしょうか?
AttributeTargets
Method
The text was updated successfully, but these errors were encountered:
No branches or pull requests
null 許容参照型4ページ目のアノテーション属性の利用例の中にあるAllowNull属性の例が実際と異なっているようです。
記載されている説明では、
となっていますが、.NET Source Browserで見ることできる現状のコードではAllowNull属性はsetではなくプロパティ側についていました。
現在のAllowNull属性の定義では
AttributeTargets
にMethod
が含まれていないため、setだけにAllowNull属性を指定すること自体ができないはずです。preview段階のソースなどを参考にした例がそのまま残ったりしてしまっているのではないでしょうか?The text was updated successfully, but these errors were encountered: