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
Using C#-like syntax for dynamic
(and other keywords that compile to attributes)
#104
Comments
Dynamic sure but I say we can target that for another release. It seems of lower importance than the other cases you mentioned Rudimentary readonly support for example for structs is in https://github.com/ApiApprover/ApiApprover/pull/84But sure the support is probably not yet superb and could be made better
|
Another one is |
I have already come across this notation (modreq) in #54. |
I think that |
Regarding dynamic: https://sharplab.io/#gist:e22ba1bb9e308621e59bce8eaf95c021 The rabbit hole is quite deep... |
The modreq indicates how important it is as API. Modreqs are how you can express "this object requires special handling." If you access a volatile field, the compiler emits a (Happy to open a separate issue though.) |
Wow, I didn't know that's how it was encoded! 😬 Btw, your sharplab links have been missing |
Let's open another issue for volatile. |
Volatile fix seems to be more simple than dynamic. |
@sungam3r that code snippet appears to be gone; any chance that you could restore or repost it? |
Unfortunately, I don't remember anything about |
Would you be interested in showing
[System.Runtime.CompilerServices.DynamicAttribute()] object
asdynamic
, similar to the C# syntax that you'd see in intellisense when interacting with the API?An argument against it might be that it's better to put lower-level realities in your face in case the API is used from a language where the attribute is not specially-recognized.
Maybe an argument for it would be that it would be consistent with
[ParamsAttribute]
,[ExtensionAttribute]
, etc, and the same kind of thing with C# 8 attributes: #54A few other attributes have cropped up like the ones for the C# 7.0
ref
andreadonly
keywords when declaring a struct:Desugared:
https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA+ABAzAAlgQwBMIA7AGwE88YAzHAZwBcoBXMRnAMQggFgAoAN4CAvkA=
The text was updated successfully, but these errors were encountered: