d的ref-return-scope

原文
ref-return-scope易混淆.
现在规则改为:
除非return scope按源码出现的顺序(中域),否则ref-return-scope总是按ref-return scope理解.
可处理各种情况,为后向兼容,放在-preview=dip1000里面.
比如:

ref int foo(ref return scope int* p)

就是refreturn-scope.即有中域则按中域.其余:

ref int foo(ref scope return int* p)

则是ref-returnscope(中引用).

posted @ 2022-02-19 10:48  zjh6  阅读(17)  评论(0)    收藏  举报  来源