list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

E029 Constraint Type Mismatch

Umple semantic error reported when there is a type mismatch in a constraint

It is only possible to compare a String to a String, a Boolean to a Boolean, and a number to a number, etc. Violations result in a type mismatch error.

Example

// This example generates the message
class X29attrtypeconstr {
  a;
  [a > 5]
}
      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// The following shows how to avoid the message
class X29attrtypeconstr {
  Integer a;
  [a > 5]
}
      

Load the above code into UmpleOnline