igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Allow migrating of union and intersection types

Open jackofdiamond5 opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe.

At the moment we do not support fully migrating union or intersection types. Methods or properties that return such types will not be resolved properly and any migration that attempts to modify such members will be ignored.

Describe the solution you'd like

We should consider extending our existing functionality to allow the migration of union and intersection types. These types can also be a part of a generic declaration, so we need to account for that as well.

Additional context

Some variations may include:

method1<A | B>(arg1: A, arg2: B, ...args): A | B

method2<B extends A>(predicate: (value: A, ...args) => value is B): B | undefined

method3<A & B>(...args): B | undefined


prop1: A | B | undefined

prop2: A & B

A common case is the Array.find method. One of its overloads is a generic union between S and undefined. At the moment any member K accessed from the type S returned by Array.find will not be migrated. For example - grid.rowList.toArray().find(r => r.rowID === someRowID).rowID - r.rowID will be migrated successfully (providing everything is strictly typed) while find(...).rowID will not be migrated.

jackofdiamond5 avatar Nov 22 '21 13:11 jackofdiamond5

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Jan 22 '22 00:01 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Mar 24 '22 00:03 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar May 24 '22 00:05 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Jul 25 '22 00:07 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Sep 24 '22 00:09 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Nov 26 '22 00:11 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Jan 28 '23 00:01 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Apr 02 '23 00:04 github-actions[bot]