[NI] Correctly compute definitely not null type for intersection one

{ T : Any? & Foo & Bar? }!! -> { T!! & Foo & Bar }

 Also, fix bug with loosing non-representative number type.
 For example, for type { Byte & SomeType } we lost type `Byte` because
 `getDefaultPrimitiveNumberType` returns null for it

 Fixes #KT-28334 for NI
This commit is contained in:
Mikhail Zarechenskiy
2018-11-21 16:07:00 +03:00
parent aa224558bd
commit c6712ff861
8 changed files with 124 additions and 7 deletions
@@ -8420,6 +8420,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
runTest("compiler/testData/diagnostics/tests/generics/nullability/functionalBound.kt");
}
@TestMetadata("inferNotNullTypeFromIntersectionOfNullableTypes.kt")
public void testInferNotNullTypeFromIntersectionOfNullableTypes() throws Exception {
runTest("compiler/testData/diagnostics/tests/generics/nullability/inferNotNullTypeFromIntersectionOfNullableTypes.kt");
}
@TestMetadata("nullToGeneric.kt")
public void testNullToGeneric() throws Exception {
runTest("compiler/testData/diagnostics/tests/generics/nullability/nullToGeneric.kt");