Skip to content

Commit

Permalink
Use final annotation
Browse files Browse the repository at this point in the history
If final="1" is set we skip the heuristic to determine whether a class
is final.

Fixes: #1204
  • Loading branch information
A6GibKm committed May 31, 2024
1 parent 1ebe20c commit 20dc4e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/library_postprocessing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ impl Library {
// The config might also be used to override a type that is wrongly
// detected as final type otherwise
*final_type
} else if klass.final_type {
true
} else if klass.type_struct.is_none() {
!self.has_subtypes(tid)
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ impl Library {
};

let is_abstract = elem.attr("abstract").map_or(false, |x| x == "1");
let final_type = elem.attr("final").map_or(false, |x| x == "1");

let mut fns = Vec::new();
let mut signals = Vec::new();
Expand Down Expand Up @@ -255,7 +256,7 @@ impl Library {
properties,
parent,
implements: impls,
final_type: false, // this will be set during postprocessing
final_type,
doc,
doc_deprecated,
version,
Expand Down

0 comments on commit 20dc4e1

Please sign in to comment.