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

Contracts (inv, pre, post) cannot be used in aspect classes #46

Open
dvojtise opened this issue Apr 29, 2016 · 0 comments
Open

Contracts (inv, pre, post) cannot be used in aspect classes #46

dvojtise opened this issue Apr 29, 2016 · 0 comments

Comments

@dvojtise
Copy link
Contributor

The @contract + @inv for design by contract with K3 cannot be used with the @aspect annotations.

this simple example (on top of ecore )

package hello_ecore

import org.eclipse.emf.ecore.EPackage
import fr.inria.diverse.k3.al.annotationprocessor.Aspect

import static extension hello_ecore.EPackageAspect.*
import fr.inria.diverse.k3.al.annotationprocessor.Contracted
import fr.inria.diverse.k3.al.annotationprocessor.Inv

@Aspect(className=EPackage)
@Contracted
class EPackageAspect { 

//  @Inv def boolean noPackageInName(){
//      return _self.name.nullOrEmpty || !_self.name.contains("Package")
//  }

    @Inv def boolean inv() { true }
}

raises the following error :

Invariant methods cannot declare any parameter

The same error occurs with pre and post conditions

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

No branches or pull requests

1 participant