Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

expose assertion annotations through AssertionError instances #4569

Closed
CeylonMigrationBot opened this issue Nov 5, 2015 · 3 comments
Closed

Comments

@CeylonMigrationBot
Copy link

[@Zambonifofex] 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?

[Migrated from ceylon/ceylon-spec#1463]

@CeylonMigrationBot
Copy link
Author

[@gavinking] That's an interesting idea.

@ghost
Copy link

ghost commented Mar 12, 2017

Seems to me that since 1.3.2, an assertion’s documentation can’t be seen as an annotation anymore (since now it can accept interpolation).

So I think this should be closed. What do you think, @gavinking?

@gavinking
Copy link
Contributor

@Zambonifofex This was actually not a bad idea at all. I like it! But yeah, I guess it's out of the question now.

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

No branches or pull requests

2 participants