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

User Manual    [Previous]   [Next]   

E216 Twice Binding of a Parameter

Umple semantic error related to binding a template parameter twice

When using traits, we can bind values for template parameters. In the process of binding, we can bind two values for a template parameter. This brings a case in which there is no clear binding. The Umple compiler detects this case and prevents the system from being compiled.

Example

  1. // In this example, there is an error  
  2. // because there are two bindings for  
  3. // template parameter "X" in class "A".  
  4. class A{  
  5.     isA T< X = B , X = C >;  
  6. }  
  7. Class B{  
  8.     //elements  
  9. }  
  10. Class C{  
  11.     //elements  
  12. }  
  13. trait T<X,Z>{  
  14.     //elements  
  15. }  
  16.         

Load the above code into UmpleOnline