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

List<String> to List<Id> cast issue #293

Open
kjonescertinia opened this issue Oct 15, 2024 · 1 comment
Open

List<String> to List<Id> cast issue #293

kjonescertinia opened this issue Oct 15, 2024 · 1 comment

Comments

@kjonescertinia
Copy link
Contributor

Was happy with:
Set chainIds = new Set();
if (chainOfIdsStr != null && chainOfIdsStr.trim().length() > 0) {
chainIds.addAll(chainOfIdsStr.split(Constants.RPG_ID_CHAIN_DELIMITER));
}

whereas the Apex compiler requires an extra cast (from List to List):
Set chainIds = new Set();
if (chainOfIdsStr != null && chainOfIdsStr.trim().length() > 0) {
chainIds.addAll((List) chainOfIdsStr.split(Constants.RPG_ID_CHAIN_DELIMITER));
}

@pwrightcertinia
Copy link
Contributor

This is presumably because we support Id/String as assignable here but the handling for collections seems to be different.

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