KTIJ-26576 [Analysis API] Add where clause to classHeaderParts in FirTowerDataContextAllElementsCollector
In `where` clause there are type constraints, and there are no supertypes scopes at those positions ^KTIJ-26576 Fixed
This commit is contained in:
+6
@@ -645,6 +645,12 @@ public class FirIdeNormalAnalysisSourceModuleReferenceShortenerTestGenerated ext
|
||||
public void testTypeBound_nested() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses/classHeaderPositions/typeBound_nested.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeBound_whereClause.kt")
|
||||
public void testTypeBound_whereClause() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses/classHeaderPositions/typeBound_whereClause.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -645,6 +645,12 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceShortenerTestGenera
|
||||
public void testTypeBound_nested() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses/classHeaderPositions/typeBound_nested.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeBound_whereClause.kt")
|
||||
public void testTypeBound_whereClause() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses/classHeaderPositions/typeBound_whereClause.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FILE: main.kt
|
||||
|
||||
abstract class Outer {
|
||||
abstract class Nested : Outer()
|
||||
}
|
||||
|
||||
class Foo<T> : Outer.Nested() where T : <expr>Outer.Nested</expr>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
Before shortening: Outer.Nested
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] Outer.Nested
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] Outer.Nested
|
||||
+1
@@ -157,6 +157,7 @@ private fun KtClassOrObject.containsInHeader(element: PsiElement): Boolean {
|
||||
addIfNotNull(getContextReceiverList())
|
||||
addIfNotNull(modifierList) // for annotations declared on class
|
||||
addIfNotNull(typeParameterList)
|
||||
addIfNotNull(typeConstraintList) // `where` clause type constraints
|
||||
|
||||
for (superTypeEntry in superTypeListEntries) {
|
||||
addIfNotNull(superTypeEntry.typeReference)
|
||||
|
||||
Reference in New Issue
Block a user