diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-06-16 19:28:24 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-02-19 13:29:33 +0100 |
commit | c16b665cb90c66c5ed8362fa70989bde1eaee272 (patch) | |
tree | 6728eb7f02af42ac98166f5f0961aff4ee30eb07 /libvaladoc | |
parent | c24a807efe5f06e04d6839a48521730d20769045 (diff) | |
download | vala-c16b665cb90c66c5ed8362fa70989bde1eaee272.tar.gz |
Add support for sealed classes in bindings
The "sealed" keyword was available and parsed for a long time. So simply
pick it up information and expose it in the AST.
Issue an error when it is used in vala source.
See https://gitlab.gnome.org/GNOME/vala/issues/278
Diffstat (limited to 'libvaladoc')
-rw-r--r-- | libvaladoc/api/class.vala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libvaladoc/api/class.vala b/libvaladoc/api/class.vala index 9c003e8ab..02f4917d1 100644 --- a/libvaladoc/api/class.vala +++ b/libvaladoc/api/class.vala @@ -78,6 +78,7 @@ public class Valadoc.Api.Class : TypeSymbol { this.is_fundamental = data.is_fundamental (); this.is_abstract = data.is_abstract; + this.is_sealed = data.is_sealed; } string? _get_private_cname (Vala.Class element) { @@ -258,6 +259,15 @@ public class Valadoc.Api.Class : TypeSymbol { } /** + * Specifies whether this class is sealed. Sealed classes may not be + * sub-classed. + */ + public bool is_sealed { + private set; + get; + } + + /** * Specifies whether this class is fundamental. */ public bool is_fundamental { @@ -322,6 +332,9 @@ public class Valadoc.Api.Class : TypeSymbol { if (is_abstract) { signature.append_keyword ("abstract"); } + if (is_sealed) { + signature.append_keyword ("sealed"); + } signature.append_keyword ("class"); signature.append_symbol (this); |