Skip to content

Generic typechecked interfaces #7232

@Rageoholic

Description

@Rageoholic

So one thing we do a lot is pass in a type to specialize on. And thanks to std.meta.traits we can write functions that are arbitrarily complex and get a bool back that tells us if it fulfills some requirements. However right now you have to put checking for traits in the function and not as part of the signature. While this isn't the biggest deal I think it would be a good idea to be able to put in a set of boolean expressions evaluated at comptime and if any of them evaluates to false it will result in a compile error that tells you which expressions evaluated to false. This should let us put the compile error at the call site rather than in the function and it removes some code duplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions