Changes in / [6385d62:807ce84]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/proposals/associated_types.md

    r6385d62 r807ce84  
    5050### Nominal Inheritance ###
    5151
    52 This trait specialization syntax could also be used, with a new annotation on the traits, to provide nominal inheritance of traits, e.g:
     52This trait specialization syntax could also be used, with a new type of type assertion, to provide nominal inheritance of traits, e.g:
    5353
    54         extern trait random_access_iterator(otype I | forward_iterator(I)) {};
     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        };
    5557
    5658        forall(otype T) random_access_iterator(vector_iter(T)) {};
    57 
    58 I 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.