Minor. fixes after review

This commit is contained in:
Stanislav Erokhin
2016-06-03 19:11:09 +03:00
parent 797ef8d143
commit 8c2ad82de7
17 changed files with 81 additions and 35 deletions
@@ -92,6 +92,8 @@ public class JvmSerializerExtension extends SerializerExtension {
if (flexibleType instanceof RawTypeImpl) {
lowerProto.setExtension(JvmProtoBuf.isRaw, true);
// we write this Extension for compatibility with old compiler
upperProto.setExtension(JvmProtoBuf.isRaw, true);
}
}
@@ -92,15 +92,7 @@ public class PossiblyBareType {
return isBareTypeNullable() ? this : bare(getBareTypeConstructor(), true);
}
KotlinType nullableActualType = TypeUtils.makeNullable(getActualType());
AbbreviatedType abbreviatedType = SpecialTypesKt.getAbbreviatedType(getActualType());
if (abbreviatedType == null) {
return type(nullableActualType);
}
else {
return type(abbreviatedType.makeNullableAsSpecified(true));
}
return type(TypeUtils.makeNullable(getActualType()));
}
@NotNull
@@ -0,0 +1,17 @@
// FILE: B.java
import java.util.List
public class B implements X {
@Override
List foo(List l) {
return super.foo(l);
}
}
// FILE: 1.kt
interface X {
fun foo(l: MutableList<Int>): List<String>?
}
internal class C : B()
@@ -0,0 +1,24 @@
package
public open class B : X {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override() public/*package*/ open override /*1*/ fun foo(/*0*/ l: kotlin.collections.MutableList<(raw) kotlin.Any?>): kotlin.collections.List<(raw) kotlin.Any?>?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
internal final class C : B {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override() public/*package*/ open override /*1*/ /*fake_override*/ fun foo(/*0*/ l: kotlin.collections.MutableList<(raw) kotlin.Any?>): kotlin.collections.List<(raw) kotlin.Any?>?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface X {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ l: kotlin.collections.MutableList<kotlin.Int>): kotlin.collections.List<kotlin.String>?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -12,7 +12,6 @@ public class A<T> {
// FILE: B.java
// TODO: E shoult has supertype A<*> which is raw type
public class B<E extends A> {
public E foo() { return null;}
E field;
@@ -27,6 +26,7 @@ public class Test {
// FILE: main.kt
fun foo(x: B<*>) {
// TODO: x.foo() now is flexible type instead of raw, because of captured type approximation
val q: MutableList<String> = x.foo().getChildrenStubs()
// Raw(B).field erased to A<Any!>..A<out Any!>?
@@ -13475,6 +13475,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("rawEnhancment.kt")
public void testRawEnhancment() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.kt");
doTest(fileName);
}
@TestMetadata("rawSupertype.kt")
public void testRawSupertype() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawSupertype.kt");