apex-dev-tools / apex-ls

Apex language server library
Other
2 stars 1 forks source link

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

Open kjonescertinia opened 2 weeks ago

kjonescertinia commented 2 weeks ago

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 commented 2 weeks ago

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