Skip to content
New issue

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

nullable value typesのobjectへの代入 #292

Open
ufcpp opened this issue Mar 24, 2020 · 0 comments
Open

nullable value typesのobjectへの代入 #292

ufcpp opened this issue Mar 24, 2020 · 0 comments

Comments

@ufcpp
Copy link
Owner

ufcpp commented Mar 24, 2020

nullable の box 命令解釈、JIT レベルで特殊処理されてるって話、どこかには書いた記憶あるんだけど、 ufcpp.net 内にはないっぽい?

検索で出てきてる感じ、build insider で書いてるっぽい?
これ、一応、null 許容値型ボックス化 にも同じようなこと書いておいた方がいいかも。

Nullable<T> と全く同じ構造の Optional<T> なり MyNullable<T> なりを作っても、T? と同じ挙動は絶対にできない。
なんせ C# → IL へのコンパイル時点では普通に box 命令が出てて、そこを特殊処理で null or T な値の box 化してるのはほんとに JIT のレベル。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant