mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Emit deprecation warnings
This commit is contained in:
parent
8fab7c1706
commit
94db929f74
9 changed files with 102 additions and 2 deletions
|
@ -57,6 +57,17 @@ class TypeName(AstNode):
|
|||
if not self.tokens["extern"]:
|
||||
self.root.gir.validate_ns(self.tokens["namespace"])
|
||||
|
||||
@validate()
|
||||
def deprecated(self) -> None:
|
||||
if self.gir_type and self.gir_type.deprecated:
|
||||
hints = []
|
||||
if self.gir_type.deprecated_doc:
|
||||
hints.append(self.gir_type.deprecated_doc)
|
||||
raise CompileWarning(
|
||||
f"{self.gir_type.full_name} is deprecated",
|
||||
hints=hints,
|
||||
)
|
||||
|
||||
@property
|
||||
def gir_ns(self):
|
||||
if not self.tokens["extern"]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue