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

expose assertion annotations through AssertionError instances #1463

Open
ghost opened this issue Nov 5, 2015 · 1 comment
Open

expose assertion annotations through AssertionError instances #1463

ghost opened this issue Nov 5, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 5, 2015

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?

@gavinking
Copy link
Member

That's an interesting idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant