Changeset f7b9faf for doc/proposals


Ignore:
Timestamp:
Jun 26, 2017, 1:05:32 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
6385d62
Parents:
74e58ea3
Message:

Updated associated types working doc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/proposals/associated_types.md

    r74e58ea3 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.