Skip to content

expose assertion annotations through AssertionError instances #1463

@ghost

Description

The title is pretty self explanatory. It means that if you have an assertion with annotations, the AssertionError thrown will contain the instances of the annotations' classes.

try
{
    "foo"
    bar baz qux assert(exists obj);
}
catch(AssertionError error)
{
    print(error.annotations);
}

The other day I was just thinking about how useless annotations in assertions are. It feels weird to allow such thing only so you can have the doc annotation there. I thought then: to solve the problem "they don't do anything", instead of disallowing them, why not make them actually do stuff?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions