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

Constraints can't refer to items in superclasses and have other glitches #1465

Open
TimLethbridge opened this issue Jun 21, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@TimLethbridge
Copy link
Member

commented Jun 21, 2019

In the following code there are several problems:

class A {
  Integer p;
  Integer q;
  Integer r;
  Integer s;
  Integer t;
  Integer u;
  Integer v;
  Integer w;
  [ r > s]
  [ t > (u+1)]
  [ v > (w-1)]
}
class B {
  isA A;
  [ p > q]
}
class C {
   isA A;
  [ r > (s+1)]
}

Here are the error messages and why they are wrong:

A minus sign can't be used as an operator

Warning on line 12 : Constraint syntax, v > (w-1), could not be processed. It has been considered as Extra Code. More information (1010)

A constraint can't refer to an attribute defined in a superclass

Error on line 20 : Attribute 'r' in constraint is not defined in class 'C'. More information (28)
Error on line 20 : Attribute 's' in constraint is not defined in class 'C'. More information (28)
Error on line 16 : Attribute 'p' in constraint is not defined in class 'B'. More information (28)
Error on line 16 : Attribute 'q' in constraint is not defined in class 'B'. More information (28)

Type comparison is not properly working

Error on line 20 : Constraint contains comparison between incompatible types. More information (29)
Error on line 11 : Constraint contains comparison between incompatible types. More information (29)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.