KT-5425 Kotlin plugin crashes when project uses RxJava 17.0 or older

#KT-5425 Fixed
This commit is contained in:
Andrey Breslav
2014-07-08 21:41:48 +04:00
parent b1065520fb
commit e3b1639edf
4 changed files with 28 additions and 2 deletions
@@ -0,0 +1,21 @@
// FILE: j/OnSubscribe.java
package j;
public interface OnSubscribe<T> {
void f();
}
// FILE: j/Observable.java
package j;
public class Observable<T> {
protected Observable(OnSubscribe<T> f) {
}
}
// FILE: Kotlin.kt
import j.*
class K : Observable<String>({})
@@ -5151,6 +5151,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.kt");
}
@TestMetadata("samInConstructorWithGenerics.kt")
public void testSamInConstructorWithGenerics() throws Exception {
doTest("compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.kt");
}
@TestMetadata("Simple.kt")
public void testSimple() throws Exception {
doTest("compiler/testData/diagnostics/tests/j+k/Simple.kt");
@@ -74,7 +74,7 @@ public class JavaConstructorDescriptor extends ConstructorDescriptorImpl impleme
@Nullable FunctionDescriptor original,
@NotNull Kind kind
) {
if (kind != Kind.DECLARATION) {
if (kind != Kind.DECLARATION && kind != Kind.SYNTHESIZED) {
throw new IllegalStateException("Attempt at creating a constructor that is not a declaration: \n" +
"copy from: " + this + "\n" +
"newOwner: " + newOwner + "\n" +
@@ -112,7 +112,7 @@ public class ConstructorDescriptorImpl extends FunctionDescriptorImpl implements
@Nullable FunctionDescriptor original,
@NotNull Kind kind
) {
if (kind != Kind.DECLARATION) {
if (kind != Kind.DECLARATION && kind != Kind.SYNTHESIZED) {
throw new IllegalStateException("Attempt at creating a constructor that is not a declaration: \n" +
"copy from: " + this + "\n" +
"newOwner: " + newOwner + "\n" +