KTIJ-27841 [AA] Do not import and shorten class constructor if it will alter other references in the file

N.B. This implementation does not 100% prevent conflicts or resolve
alterations when shortening functions.
To guarantee that,
we would need to carefully consider all the references in the file,
and to check whether they have changed their resolve in the presence
of a new import.
This is not trivial and will be approached separately under a different
task.

^KTIJ-27841 Fixed
This commit is contained in:
Roman Golyshev
2024-01-11 12:51:45 +01:00
committed by teamcity
parent 1e2f612cbc
commit 646cdb56e5
3 changed files with 28 additions and 6 deletions
@@ -1,8 +1,6 @@
Before shortening: dependency.MyFoo()
with default settings:
[qualifier] dependency.MyFoo()
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
[qualifier] dependency.MyFoo()
with SHORTEN_AND_STAR_IMPORT:
@@ -1,8 +1,6 @@
Before shortening: dependency.MyFoo()
with default settings:
[qualifier] dependency.MyFoo()
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
[qualifier] dependency.MyFoo()
with SHORTEN_AND_STAR_IMPORT: