Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/proposals/associated_types.md

    r376ccadc rf7b9faf  
    5050### Nominal Inheritance ###
    5151
    52 This trait specialization syntax could also be used, with a new type of type assertion, to provide nominal inheritance of traits, e.g:
     52This trait specialization syntax could also be used, with a new annotation on the traits, to provide nominal inheritance of traits, e.g:
    5353
    54         trait random_access_iterator(otype I | forward_iterator(I)) {
    55                 nominal; // not sure what the keyword is here, could maybe overload auto or extern
    56         };
     54        extern trait random_access_iterator(otype I | forward_iterator(I)) {};
    5755
    5856        forall(otype T) random_access_iterator(vector_iter(T)) {};
     57
     58I used `extern` here to not add a new keyword, I think it fits the idea of "the definition is somewhere else" of the existing meaning of `extern`. Other options include a zero-arg pseudo-trait `nominal()` that could go in the trait's constraint list.
Note: See TracChangeset for help on using the changeset viewer.