Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Using C#-like syntax for dynamic (and other keywords that compile to attributes) #104

@jnm2

Description

@jnm2

Would you be interested in showing [System.Runtime.CompilerServices.DynamicAttribute()] object as dynamic, 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: #54

A few other attributes have cropped up like the ones for the C# 7.0 ref and readonly keywords when declaring a struct:

public readonly ref struct Foo
{
}

Desugared:

[IsByRefLike]
[Obsolete("Types with embedded references are not supported in this version of your compiler.", true)]
[IsReadOnly]
public struct Foo
{
}

https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA+ABAzAAlgQwBMIA7AGwE88YAzHAZwBcoBXMRnAMQggFgAoAN4CAvkA=

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions