mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
CPP: fix struct which have a field with the same name as the struct
The operator== reference the struct name, so if there is a field with the same name, we should disambiguate Fix tests/cases/issues/name_conflicts.slint that was added in last commit
This commit is contained in:
parent
11d404a216
commit
acb41d8244
1 changed files with 1 additions and 1 deletions
|
@ -659,7 +659,7 @@ fn generate_struct(file: &mut File, name: &str, fields: &BTreeMap<String, Type>)
|
|||
Access::Public,
|
||||
Declaration::Function(Function {
|
||||
name: "operator==".to_owned(),
|
||||
signature: format!("(const {0} &a, const {0} &b) -> bool = default", name),
|
||||
signature: format!("(const class {0} &a, const class {0} &b) -> bool = default", name),
|
||||
is_friend: true,
|
||||
statements: None,
|
||||
..Function::default()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue