mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Auto merge of #7337 - wilmoz:InheritanceDocumentation, r=mbrubeck
Documentation of inheritance in type ids Aditional documentation about this issue https://github.com/servo/servo/issues/7205 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7337) <!-- Reviewable:end -->
This commit is contained in:
commit
da0b9d7c01
1 changed files with 17 additions and 0 deletions
|
@ -54,6 +54,23 @@
|
||||||
//! This invariant is enforced by the lint in
|
//! This invariant is enforced by the lint in
|
||||||
//! `plugins::lints::inheritance_integrity`.
|
//! `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
|
//! Construction
|
||||||
//! ============
|
//! ============
|
||||||
//!
|
//!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue