K2: Fix false-positive RETURN_TYPE_MISMATCH_ON_OVERRIDE

The reason was that `substitutorByMap` ignored the difference between
`T` and `T?`

^KT-57001 Fixed
This commit is contained in:
Denis.Zharkov
2023-03-28 11:00:00 +02:00
committed by Space Team
parent ac8cbcafb4
commit d9ca77f716
7 changed files with 42 additions and 1 deletions
@@ -0,0 +1,11 @@
// FIR_IDENTICAL
// ISSUE: KT-57001
interface ConverterFromString<T> {
fun ofS(s: String): T
fun nullable(nullText: String): ConverterFromString<T?> = object: ConverterFromString<T?> {
override fun ofS(s: String): T? = if (s == nullText) null else this@ConverterFromString.ofS(s)
}
}