Commit 5a728bba authored by Jinseong Jeon's avatar Jinseong Jeon
Browse files

FIR UAST: use fully expanded type when computing nullability

^KT-62757
parent 16db5dfd
Showing with 5 additions and 1 deletion
+5 -1
......@@ -142,11 +142,14 @@ interface UastApiFixtureTestBase : UastPluginSelection {
interface State<out T> {
val value: T
}
typealias NullableString = String?
@Deprecated(level = DeprecationLevel.HIDDEN, message="no longer supported")
fun before(
i : Int?,
s : String?,
ns : NullableString,
vararg vs : Any,
): State<String> {
return object : State<String> {
......@@ -157,6 +160,7 @@ interface UastApiFixtureTestBase : UastPluginSelection {
fun after(
i : Int?,
s : String?,
ns : NullableString,
vararg vs : Any,
): State<String> {
return object : State<String> {
......
......@@ -273,7 +273,7 @@ context(KtAnalysisSession)
internal fun nullability(ktType: KtType?): KtTypeNullability? {
if (ktType == null) return null
if (ktType is KtErrorType) return null
return if (ktType.canBeNull)
return if (ktType.fullyExpandedType.canBeNull)
KtTypeNullability.NULLABLE
else
KtTypeNullability.NON_NULLABLE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment