Minor. Add tests checking not-null assertions

More precisely these tests check cases when expected type
was somehow obtained from captured type (in member scope with projections)
This commit is contained in:
Denis Zharkov
2015-12-22 11:45:02 +03:00
parent 7aaa6422b4
commit 58caff3411
4 changed files with 32 additions and 4 deletions
@@ -27,10 +27,8 @@ import org.jetbrains.kotlin.resolve.calls.context.CallResolutionContext
import org.jetbrains.kotlin.resolve.calls.context.ResolutionContext
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
import org.jetbrains.kotlin.types.upperIfFlexible
public class RuntimeAssertionInfo(public val needNotNullAssertion: Boolean, public val message: String) {
public interface DataFlowExtras {
@@ -53,7 +51,7 @@ public class RuntimeAssertionInfo(public val needNotNullAssertion: Boolean, publ
dataFlowExtras: DataFlowExtras
): RuntimeAssertionInfo? {
fun assertNotNull(): Boolean {
if (expectedType.isError() || expressionType.isError()) return false
if (expectedType.isError || expressionType.isError) return false
// T : Any, T! = T..T?
// Let T$ will be copy of T! with enhanced nullability.