conform to return-ref-scope ordering#10782
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#10782" |
|
See #10782 for phobos fixes |
| if (storageClasses[i] & ParameterStorageClass.return_) | ||
| result ~= "return "; | ||
| if (storageClasses[i] & ParameterStorageClass.scope_) | ||
| result ~= "scope "; |
There was a problem hiding this comment.
Why put return under the scope instead of ref? That looks like a breaking change as return ref scope will now be translated to return scope by ReplaceTypeUnless. Although, it's not ideal either way when ParameterStorageClass doesn't know about the storage class order like the compiler does.
There was a problem hiding this comment.
The design of this function is deficient because one cannot control the order of ref, return and scope. I did the best I could with it to keep it working with the unittests.
There was a problem hiding this comment.
return ref and return scope should be distinct parameter storage classes, like in the compiler.
No description provided.