Take nullability annotations into account in QF correcting override

So Java NotNull annotated is converted to `Type`
and Java Nullable annotated to `Type?` accordingly

So #KT-19299 Fixed
This commit is contained in:
Toshiaki Kameyama
2017-07-31 09:34:02 +03:00
committed by Mikhail Glukhikh
parent 1264ed7c86
commit 64eeb479aa
3 changed files with 57 additions and 2 deletions
@@ -0,0 +1,38 @@
// FILE: test.before.kt
// "Change function signature to 'fun foo(a: String, b: String?, c: String?)'" "true"
// ERROR: 'foo' overrides nothing
package foo
class KotlinClass : JavaClass() {
<caret>override fun foo() {
}
}
// FILE: foo/JavaClass.java
package foo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class JavaClass {
void foo(@NotNull String a,
@Nullable String b,
@JavaAnnotation String c) {
}
}
// FILE: foo/JavaAnnotation.java
package foo;
public @interface JavaAnnotation {
}
// FILE: test.after.kt
// "Change function signature to 'fun foo(a: String, b: String?, c: String?)'" "true"
// ERROR: 'foo' overrides nothing
package foo
class KotlinClass : JavaClass() {
<caret>override fun foo(a: String, b: String?, @JavaAnnotation c: String?) {
}
}