Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic bridge example build error(no viable overloaded) [BUG] #26203

Closed
jinbiaochenstayhungry opened this issue Apr 24, 2023 · 1 comment
Closed

Comments

@jinbiaochenstayhungry
Copy link
Contributor

Reproduction steps

1、update zap project to the latest.
2、/scripts/tools/zap/generate.py .... bridge-app.zap
3、then build dynamic bridge example,will show error log below:

gen/bridge/BridgeGlobalStructs.h:19:21: error: no viable overloaded '='
applicationID = t.applicationID;

Bug prevalence

whenerver i do this

GitHub hash of the SDK that was being used

76eaffc

Platform

darwin

Platform Version(s)

No response

Anything else?

after i check the code in matter and found that, new version zap will generate elements below in .matter file:

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

and in the src/app/zzz_template/common/override i can see:

case 'char_string':
case 'long_char_string':
return 'chip::CharSpan';

which means t.applicationID will be a chip::CharSpan type,
but in scripts/py_matter_idl/matter_idl/generators/types.py, check the code

elif lowercase_name in ['char_string', 'long_char_string']:
return BasicString(idl_name=lowercase_name, is_binary=False, max_length=data_type.max_length)

applicationID will be generate as type std::string.

which case no viable overloaded.
more detail error log:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:905:19: note: candidate function not viable: no known conversion from 'chip::CharSpan' (aka 'Span') to 'const std::string' for 1st argument

i think this is a bug, or may be i miss something.

@bzbarsky-apple
Copy link
Contributor

76eaffc

This was fixed since then. See #26129. Update to a newer SHA, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants