title: Validating unique names for strings and optional reference
body: <p>New to XText, I am struggling with two issues with the following MWE grammar.</p>
  
  <pre><code>Metamodel:
      (classes += Type)*
  ;
  
  Type:
      Enumeration | Class
  ;
  
  
  Enumeration:
      'enumeration' name = ValidID '{' (literals += EnumLiteral ';')+ '}'
  ;
  EnumLiteral:
      ValidID
  ;
  
  
  Class:
      'class' name = ValidID '{'
          (references += Reference)*
  '}'
  ;
  
  Reference:
      'reference'  name = ValidID ':' type = Class ('#' opposite = [Reference])?
  ;
  </code></pre>
  
  <p>So my questions are:</p>
  
  <ol>
  <li><p>Since the enumeration literals list is ValidID, it seems to be represented by EStrings. The documentation does not seem to deal with the case of primitive types in ECore. How is it possible to check for non-duplicates in literals, and report it adequately in the editor (i.e., the error should be at the first occurence of a repeated literal)?</p></li>
  <li><p>Despite my best efforts, I was unable to write a custom scope for the opposite reference. Since XText uses reflection for retrieving the scoping methods, I suspect I don't have the correct one: I tried <code>def scope_Reference_opposite(Reference context, EReference r)</code>, is it correct? An example would be really appreciated, from which I am confident I can easily adapt to my "real" DSL.</p></li>
  </ol>
  
  <p>Thanks a lot for the help, you will save me a lot of time looking again and again for a solution in documentation...</p>