andresteingress / gcontracts

GContracts: Programming by Contract for Groovy
http://gcontracts.org
114 stars 11 forks source link

AssertionErrors should have line numbers #6

Closed HamletDRC closed 14 years ago

HamletDRC commented 14 years ago

the stack trace of an assertion error does not have a line number.

Here is my stack trace:

Caught: java.lang.AssertionError: [precondition] In method <accelerate(increase:java.lang.Object)> violated. Expression: $preconditionClosure.call() at gcontracts.Rocket.accelerate(Rocket.groovy) at gcontracts.BadRocket.run(BadRocket.groovy:7)

See how Rocket.groovy has no line number?

I think your synthesized AssertionStatement nodes should carry the same line numbers as the @Requires annotation. I think you are probably forgetting to fill it in.

andresteingress commented 14 years ago

fixed in master.