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

dsl: add Type.OfKind method #332

Merged
merged 1 commit into from Jan 1, 2022
Merged

dsl: add Type.OfKind method #332

merged 1 commit into from Jan 1, 2022

Commits on Jan 1, 2022

  1. dsl: add Type.OfKind method

    This allows a more concise and efficient checking for
    numeric type ranges.
    
    For instance, these are identical in semantics:
    
    ```
            Type.Is("int") || Type.Is("int8") || Type.Is("int16") ||
                    Type.Is("int32") || Type.Is("int64")
            =
            Type.OfKind("int")
    
            Type.Is("uint") || Type.Is("uint8") || Type.Is("uint16") ||
                    Type.Is("uint32") || Type.Is("uint64")
            =
            Type.OfKind("uint")
    ```
    
    There are other useful kinds like "numeric", "signed", "unsigned", etc.
    quasilyte committed Jan 1, 2022
    Configuration menu
    Copy the full SHA
    bbc37f6 View commit details
    Browse the repository at this point in the history