In scenarios like the one described in the sample, there may arise situations where dependent types require a union of types rather than individual ones. To address this, the PR introduces an additional code action with a union type alongside the existing ones to cover this specific use case.
Fixes #42591
Approach
Return the union of all the possible types along with the ones that are already provided in the respective code action.
Purpose
In scenarios like the one described in the sample, there may arise situations where dependent types require a union of types rather than individual ones. To address this, the PR introduces an additional code action with a union type alongside the existing ones to cover this specific use case.
Fixes #42591
Approach
Return the union of all the possible types along with the ones that are already provided in the respective code action.
Samples
https://github.com/ballerina-platform/ballerina-lang/assets/59343084/a8f874a2-b670-49bb-994f-b3b93fd37348
Check List