K2: handle alias-based types nullability properly in ConeTypeContext
#KT-60154 Fixed
This commit is contained in:
committed by
Space Team
parent
f4ba5aaf9a
commit
a428ab6ed6
+6
@@ -41290,6 +41290,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nothingTypeAlias.kt")
|
||||
public void testNothingTypeAlias() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/nothingTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasSamAdapterConstructors.kt")
|
||||
public void testTypeAliasSamAdapterConstructors() throws Exception {
|
||||
|
||||
+6
@@ -41290,6 +41290,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nothingTypeAlias.kt")
|
||||
public void testNothingTypeAlias() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/nothingTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasSamAdapterConstructors.kt")
|
||||
public void testTypeAliasSamAdapterConstructors() throws Exception {
|
||||
|
||||
+6
@@ -41354,6 +41354,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nothingTypeAlias.kt")
|
||||
public void testNothingTypeAlias() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/nothingTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasSamAdapterConstructors.kt")
|
||||
public void testTypeAliasSamAdapterConstructors() throws Exception {
|
||||
|
||||
+6
@@ -41468,6 +41468,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nothingTypeAlias.kt")
|
||||
public void testNothingTypeAlias() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/nothingTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasSamAdapterConstructors.kt")
|
||||
public void testTypeAliasSamAdapterConstructors() throws Exception {
|
||||
|
||||
@@ -143,12 +143,12 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty
|
||||
|
||||
override fun SimpleTypeMarker.isMarkedNullable(): Boolean {
|
||||
require(this is ConeKotlinType)
|
||||
return this.nullability.isNullable
|
||||
return fullyExpandedType(session).nullability.isNullable
|
||||
}
|
||||
|
||||
override fun SimpleTypeMarker.withNullability(nullable: Boolean): SimpleTypeMarker {
|
||||
require(this is ConeKotlinType)
|
||||
return withNullability(ConeNullability.create(nullable), session.typeContext)
|
||||
return fullyExpandedType(session).withNullability(ConeNullability.create(nullable), session.typeContext) as SimpleTypeMarker
|
||||
}
|
||||
|
||||
override fun SimpleTypeMarker.typeConstructor(): TypeConstructorMarker {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-60154
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
interface Column<TData : Any, TValue>
|
||||
|
||||
fun <T : Any> column(): Column<T, Void> = TODO()
|
||||
|
||||
fun <T : Any> column(id: String): Column<T, String> = TODO()
|
||||
|
||||
typealias Void = Nothing?
|
||||
|
||||
// MODULE: app(lib)
|
||||
// FILE: app.kt
|
||||
|
||||
interface RowData<T : Comparable<T>>
|
||||
|
||||
typealias ReadonlyArray<T> = Array<out T>
|
||||
|
||||
private val ALL_COLUMNS: ReadonlyArray<Column<RowData<*>, *>> = arrayOf(column(id = ""), column())
|
||||
Generated
+6
@@ -42472,6 +42472,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nothingTypeAlias.kt")
|
||||
public void testNothingTypeAlias() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/typealias/nothingTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasSamAdapterConstructors.kt")
|
||||
public void testTypeAliasSamAdapterConstructors() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user