Fix primitive types mapping

Use boxed version if type was enhaced to not-nullable
This commit is contained in:
Denis Zharkov
2016-02-05 11:17:39 +03:00
parent 68110f5859
commit c879f83037
7 changed files with 21 additions and 5 deletions
@@ -20,6 +20,7 @@ import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
import org.jetbrains.kotlin.jvm.bindingContextSlices.RUNTIME_ASSERTION_INFO
import org.jetbrains.kotlin.load.java.typeEnhancement.hasEnhancedNullability
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.calls.checkers.AdditionalTypeChecker
@@ -74,9 +75,6 @@ class RuntimeAssertionInfo(val needNotNullAssertion: Boolean, val message: Strin
else
null
}
private fun KotlinType.hasEnhancedNullability()
= annotations.findAnnotation(JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION) != null
}
}