KT-5697 Duplicate Unit type

#KT-5697 Fixed
This commit is contained in:
Andrey Breslav
2014-08-28 19:03:58 +04:00
parent ec12d1d71d
commit d80907543f
3 changed files with 26 additions and 1 deletions
@@ -115,7 +115,7 @@ public class JvmCodegenUtil {
}
private static boolean rawTypeMatches(JetType type, ClassifierDescriptor classifier) {
return type.getConstructor().getDeclarationDescriptor().getOriginal() == classifier.getOriginal();
return type.getConstructor().equals(classifier.getTypeConstructor());
}
private static boolean isCallInsideSameClassAsDeclared(@NotNull CallableMemberDescriptor descriptor, @NotNull CodegenContext context) {
@@ -0,0 +1,20 @@
// FILE: f1.kt
package kotlin
class Unit
// FILE: f2.kt
class C: MutableIterator<Int> {
override fun remove(): Unit {
throw UnsupportedOperationException()
}
override fun next(): Int {
throw UnsupportedOperationException()
}
override fun hasNext(): Boolean {
throw UnsupportedOperationException()
}
}
@@ -5372,6 +5372,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/multimodule/duplicateClass"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("collectionMethodStub.kt")
public void testCollectionMethodStub() throws Exception {
doTest("compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.kt");
}
@TestMetadata("differentGenericArguments.kt")
public void testDifferentGenericArguments() throws Exception {
doTest("compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArguments.kt");