andresteingress / gcontracts

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

Error when constructor parameter and instance variables have the same identifier #33

Closed andresteingress closed 11 years ago

andresteingress commented 11 years ago

In the following code sample

import org.gcontracts.annotations.*

class A {
    private final String a
    private final String b

    @Requires({ a && b })
    A(String a, String b) {
        this.a = a
        this.b = b
    }
}

the precondition should be called on the method parameters a and b, but in fact it is called on the instance variables.