Documentation of inheritance in type ids

This commit is contained in:
wilmoz 2015-08-24 12:08:11 -05:00
parent 524b02dbf7
commit 1830ada4bc

View file

@ -54,6 +54,23 @@
//! This invariant is enforced by the lint in
//! `plugins::lints::inheritance_integrity`.
//!
//! The same principle applies to typeids,
//! the derived type enum should
//! use one addititional type (the parent class) because sometimes the parent
//! can be the most-derived class of an object.
//! ```ignore
//! pub enum EventTypeId {
//! UIEvent(UIEventTypeId),
//! //others events
//! }
//!
//! pub enum UIEventTypeId {
//! MouseEvent,
//! KeyboardEvent,
//! UIEvent, //<- parent of MouseEvent and KeyboardEvent
//! }
//! ```
//!
//! Construction
//! ============
//!