Skip to content

Commit d9d0af3

Browse files
authored
Remove bogus documentation of enum inheritance (#75)
Enums can't inherit.
1 parent ecadb34 commit d9d0af3

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

source/developer-guides/bindings/writing-a-vapi-manually/04-00-recognizing-vala-semantics-in-c-code/04-02-enums-and-flags.rst

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,4 @@ There is also a common tendency to use combinable bit patterns. These are conver
6464
CREATE
6565
}
6666
67-
6867
In Vala, enums and flags may have member functions. In particular, ``strerr``-like functions are best converted to member functions.
69-
70-
Enums may also inherit, so if one set of flags is a superset of another, but they are logically separate, this can be done using inheritance.
71-
72-
.. code-block:: c
73-
74-
#define FOO_A 1
75-
#define FOO_B 2
76-
#define FOO_C 3
77-
#define FOO_D 4
78-
/* takes FOO_A or B only */
79-
void do_something(int);
80-
/* takes any FOO_ value */
81-
void do_something_else(int);
82-
83-
.. code-block:: vala
84-
85-
[CCode (cname = "int", cprefix = "FOO_", has_type_id = false)]
86-
public enum Foo { A, B }
87-
[CCode (cname = "int", cprefix = "FOO_", has_type_id = false)]
88-
public enum FooExtended : Foo { C, D }
89-

0 commit comments

Comments
 (0)