[FIR-TEST] Add new testdata generated after changes in previous commit

This commit is contained in:
Dmitriy Novozhilov
2019-12-11 16:16:22 +03:00
parent e9c02a1cca
commit 2536fa0cd5
4578 changed files with 104067 additions and 1 deletions
@@ -0,0 +1,14 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo<X> {
fun foo(x: X)
}
open class FooImpl : Foo<String> {
override fun foo(x: String) {
}
}
open class FooImpl2 : FooImpl() {
fun foo(x: Any) {
}
}
@@ -0,0 +1,8 @@
open class B {
fun getX() = 1
}
class C : B() {
val x: Int
get() = 1
}
@@ -0,0 +1,5 @@
open class B {
fun getX() = 1
}
class C(val x: Int) : B()
@@ -0,0 +1,7 @@
open class B {
fun getX() = 1
}
class C : B() {
val x: Int = 1
}
@@ -0,0 +1,8 @@
open class B {
val x: Int
get() = 1
}
class C : B() {
fun getX() = 1
}
@@ -0,0 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class Base {
open fun `foo$default`(d: Derived, i: Int, mask: Int, mh: Any) {}
}
class Derived : Base() {
fun foo(i: Int = 0) {}
}
@@ -0,0 +1,10 @@
interface B {
fun getX() = 1
}
interface D {
val x: Int
}
class C(d: D) : D by d, B {
}
@@ -0,0 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class B {
fun foo(l: List<String>) {}
}
class C : B() {
fun foo(l: List<Int>) {}
}
@@ -0,0 +1,7 @@
interface B {
fun getX() = 1
}
class C : B {
override val x = 1
}
@@ -0,0 +1,8 @@
open class B {
private fun getX() = 1
}
class C : B() {
val x: Int
get() = 1
}
@@ -0,0 +1,7 @@
open class C {
val x = 1
}
interface Tr : C {
fun getX() = 1
}
@@ -0,0 +1,8 @@
interface T {
fun getX() = 1
}
class C : T {
val x: Int
get() = 1
}
@@ -0,0 +1,8 @@
interface T {
fun getX(): Int
}
abstract class C : T {
val x: Int
get() = 1
}
@@ -0,0 +1,8 @@
interface T {
val x: Int
get() = 1
}
class C : T {
fun getX() = 1
}
@@ -0,0 +1,7 @@
interface T {
val x: Int
}
abstract class C : T {
fun getX() = 1
}
@@ -0,0 +1,11 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class B<T> {
open fun foo(t: T) {}
}
class C : B<String>() {
override fun foo(t: String) {}
fun foo(o: Any) {}
}
@@ -0,0 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface B<T> {
fun foo(t: T) {}
}
class C : B<String> {
fun foo(o: Any) {}
}
@@ -0,0 +1,11 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface B<T> {
fun foo(t: T) {}
}
class C : B<String> {
override fun foo(t: String) {}
fun foo(o: Any) {}
}
@@ -0,0 +1,2 @@
val aa = 1
val Aa = 1
@@ -0,0 +1,19 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
public open class A<T> {
fun foo(x: T) = "O"
fun foo(x: A<T>) = "K"
}
interface C<E> {
fun foo(x: E): String
fun foo(x: A<E>): String
}
interface D {
fun foo(x: A<String>): String
}
class B1 : A<A<String>>(), D
interface B2 : C<A<String>>, D
@@ -0,0 +1,4 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(s: List<String>) {}
fun foo(s: MutableList<String>) {}
@@ -0,0 +1,12 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo<T> {
fun foo(l: List<T>)
}
interface Bar<T> {
fun foo(l: List<T>)
}
class Baz(f: Foo<String>, b: Bar<Int>): Foo<String> by f, Bar<Int> by b {
}
@@ -0,0 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo<T> {
fun foo(l: List<T>)
}
class Bar(f: Foo<String>): Foo<String> by f {
fun foo(l: List<Int>) {}
}
@@ -0,0 +1,15 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo<T> {
fun foo(l: List<T>) {
}
}
class Bar(f: Foo<String>): Foo<String> by f {
fun foo(l: List<Int>) {}
}
class BarOther(f: Foo<String>): Foo<String> by f {
override fun foo(l: List<String>) {}
}
@@ -0,0 +1,7 @@
class G<T>
val <T> G<T>.foo: Int
get() = 1
val G<String>.foo: Int
get() = 1
@@ -0,0 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class G<T>
fun foo(x: G<String>): G<Int> {null!!}
fun foo(x: G<Int>): G<String> {null!!}
@@ -0,0 +1,12 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo<T> {
fun foo(l: List<T>) {}
}
interface Bar<T> {
fun foo(l: List<T>) {}
}
class Baz(): Foo<String>, Bar<Int> {
}
@@ -0,0 +1,4 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -PLATFORM_CLASS_MAPPED_TO_KOTLIN
fun foo(s: List<String>) {}
fun foo(s: java.util.List<String>) {}
@@ -0,0 +1,4 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(x: String) {}
fun foo(x: String?) {}
@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface A<T> {
fun foo(l: List<T>)
}
interface B {
fun foo(l: List<Int>) {}
}
class C(f: A<String>): A<String> by f, B
class D(f: A<Int>): A<Int> by f, B
@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo<T> {
fun foo(l: List<T>) {}
}
interface Bar<T> {
fun foo(l: List<T>) {}
}
class Baz(): Foo<String>, Bar<Int> {
fun foo(l: List<Long>) {}
}
@@ -0,0 +1,4 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -PLATFORM_CLASS_MAPPED_TO_KOTLIN
fun foo(s: java.lang.String) {}
fun foo(s: String) {}
@@ -0,0 +1,4 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun <T> foo(x: T): T {null!!}
fun foo(x: Any): Any {null!!}
@@ -0,0 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo
fun <T: Foo> foo(x: T): T {null!!}
fun foo(x: Foo): Foo {null!!}
@@ -0,0 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo
interface Bar
fun <T> foo(x: T): T where T: Foo, T: Bar {null!!}
fun foo(x: Foo): Foo {null!!}
fun foo(x: Bar): Bar {null!!}
@@ -0,0 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface Foo
interface Bar
fun <T> foo(x: T): T where T: Foo, T: Bar {null!!}
fun foo(x: Foo): Foo {null!!}
fun foo(x: Bar): Bar {null!!}
@@ -0,0 +1,6 @@
enum class E {
ENTRY;
fun getDeclaringClass() {}
fun finalize() {}
}
@@ -0,0 +1,19 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-7174 Report error on members with the same signature as non-overridable methods from mapped Java types (like Object.wait/notify)
class A {
fun notify() {}
fun notifyAll() {}
fun wait() {}
fun wait(l: Long) {}
fun wait(l: Long, i: Int) {}
fun getClass(): Class<Any> = null!!
}
fun notify() {}
fun notifyAll() {}
fun wait() {}
fun wait(l: Long) {}
fun wait(l: Long, i: Int) {}
fun getClass(): Class<Any> = null!!
@@ -0,0 +1,4 @@
class C {
val x = 1
fun getX() = 1
}
@@ -0,0 +1,6 @@
class C {
companion object {
val x = 1
fun getX() = 1
}
}
@@ -0,0 +1,3 @@
class C(val x: Int) {
fun getX() = 1
}
@@ -0,0 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class C {
fun foo(x: Any) {}
fun Any.foo() {}
}
@@ -0,0 +1,7 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class C {
fun getX(t: Any) = 1
val Any.x: Int
get() = 1
}
@@ -0,0 +1,7 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class C {
fun setX(x: Int) {}
var x: Int = 1
}
@@ -0,0 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class C {
fun setX(x: Int) {}
var x: Int = 1
set(v) {}
}
@@ -0,0 +1,6 @@
fun foo() {
class C {
val x = 1
fun getX() = 1
}
}
@@ -0,0 +1,8 @@
class Outer {
fun foo() {
class C {
val x = 1
fun getX() = 1
}
}
}
@@ -0,0 +1,6 @@
class B {
class C {
val x = 1
fun getX() = 1
}
}
@@ -0,0 +1,4 @@
object C {
val x = 1
fun getX() = 1
}
@@ -0,0 +1,5 @@
fun foo() =
object {
val x = 1
fun getX() = 1
}
@@ -0,0 +1,6 @@
class Outer {
val x = object {
val x = 1
fun getX() = 1
}
}
@@ -0,0 +1,13 @@
// FILE: A.java
public class A {
public String getFoo() {
return "Foo";
}
}
// FILE: B.kt
class B(private val foo: String) : A() {
override fun getFoo(): String = foo
}
@@ -0,0 +1,2 @@
val x = 1
fun getX() = 1
@@ -0,0 +1,5 @@
// FILE: a.kt
val x = 1
// FILE: b.kt
fun getX() = 1
@@ -0,0 +1,3 @@
val x: Int
get() = 1
fun getX() = 1
@@ -0,0 +1,5 @@
interface T {
val x: Int
get() = 1
fun getX() = 1
}
@@ -0,0 +1,4 @@
interface T {
val x: ErrorType
fun getX(): ErrorType1
}
@@ -0,0 +1,68 @@
// !DIAGNOSTICS: -DUPLICATE_CLASS_NAMES
fun () {
}
fun Outer.() {
}
val<!SYNTAX!><!> : Int = 1
class<!SYNTAX!><!> {
}
object<!SYNTAX!><!> {
}
interface<!SYNTAX!><!> {
}
enum class<!SYNTAX!><!> {
}
annotation class<!SYNTAX!><!> {
}
class Outer {
fun () {
}
val<!SYNTAX!><!> : Int = 1
class<!SYNTAX!><!> {
}
object<!SYNTAX!><!> {
}
interface<!SYNTAX!><!> {
}
enum class<!SYNTAX!><!> {
}
annotation class<!SYNTAX!><!> {
}
}
fun outerFun() {
fun () {
}
fun () {
}
}
@@ -0,0 +1,5 @@
class C {
companion object {}
val Companion = C
}
@@ -0,0 +1,8 @@
class C {
companion object {
val X = 1
val `X$1` = 1
}
val X = 1
}
@@ -0,0 +1,13 @@
class B {
companion object A {
}
val A = this
}
class C {
companion object A {
val A = this
}
}
@@ -0,0 +1,5 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
data class C(val c: Int) {
fun `copy$default`(c: C, x: Int, m: Int, mh: Any) = C(this.c)
}
@@ -0,0 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class C {
fun `a$default`(c: C, x: Int, m: Int, mh: Any) {}
fun a(x: Int = 1) {}
}
@@ -0,0 +1,5 @@
interface Foo
class Bar(f: Foo) : Foo by f {
val `$$delegate_0`: Foo? = null
}
@@ -0,0 +1,7 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
enum class E {
A;
fun values(): Array<E> = null!!
fun valueOf(s: String): E = null!!
}
@@ -0,0 +1,7 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class C {
inner class D {
val `this$0`: C? = null
}
}
@@ -0,0 +1,3 @@
object O {
val INSTANCE: O = null!!
}
@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
operator fun Any.getValue(x: Any?, y: Any): Any = null!!
class C {
val x by 1
val `$$delegatedProperties`: Array<KProperty<*>> = null!!
}
val x by 1
val `$$delegatedProperties`: Array<KProperty<*>> = null!!
@@ -0,0 +1,34 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: A.java
public class A {
public static void foo() {}
public static void baz(String s) {}
}
// FILE: B.kt
open class B : A() {
}
// FILE: C.java
public class C extends B {
public static void bar(int i) {}
}
// FILE: K.kt
open class K : C() {
fun foo() {}
fun foo(a: Any) {}
fun bar(i: Int) {}
fun bar(i: String) {}
fun baz(i: Int) {}
companion object {
fun foo() {}
fun bar(i: Int) {}
}
}
@@ -0,0 +1,22 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: A.java
public class A {
public static int a = 1;
public static void foo() {}
public static void baz(String s) {}
}
// FILE: K.kt
open class K : A() {
val a = 1
fun foo() {}
fun foo(i: Int) {}
fun baz(i: Int) {}
companion object {
fun foo() {}
}
}
@@ -0,0 +1,29 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: A.java
public class A {
public static void foo() {}
public static void baz(String s) {}
}
// FILE: B.java
public class B extends A {
public static void bar(int i) {}
}
// FILE: K.kt
open class K : B() {
fun foo() {}
fun foo(a: Any) {}
fun bar(i: Int) {}
fun bar(i: String) {}
fun baz(i: Int) {}
companion object {
fun foo() {}
fun bar(i: Int) {}
}
}
@@ -0,0 +1,22 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: A.java
public interface A {
public String a = "";
public static void foo() {}
public static void baz(String s) {}
}
// FILE: K.kt
open class K : A {
val a = ""
fun foo() {}
fun foo(i: Int) {}
fun baz(i: Int) {}
companion object {
fun foo() {}
}
}
@@ -0,0 +1,29 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: A.java
public interface A {
public static void foo() {}
public static void baz(String s) {}
}
// FILE: B.java
public interface B extends A {
public static void bar(int i) {}
}
// FILE: K.kt
open class K : B {
fun foo() {}
fun foo(a: Any) {}
fun bar(i: Int) {}
fun bar(i: String) {}
fun baz(i: Int) {}
companion object {
fun foo() {}
fun bar(i: Int) {}
}
}
@@ -0,0 +1,24 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: foo/A.java
package foo;
public class A {
private static void foo(int s) {}
static void bar(double s) {}
}
// FILE: K.kt
import foo.A
open class K : A() {
fun foo(i: Int) {}
fun bar(d: Double) {}
fun baz(i: Int) {}
companion object {
fun foo(i: Int) {}
fun bar(d: Double) {}
}
}
@@ -0,0 +1,12 @@
enum class A {
A1,
A2;
fun valueOf(s: String): A = <!AMBIGUITY!>valueOf<!>(s)
fun valueOf() = "OK"
fun values(): Array<A> = null!!
fun values(x: String) = x
}
@@ -0,0 +1,7 @@
interface T {
fun getX() = 1
}
class C : T {
val x = 1
}
@@ -0,0 +1,8 @@
interface T {
fun getX() = 1
}
interface C : T {
val x: Int
get() = 1
}
@@ -0,0 +1,8 @@
interface T {
val x: Int
get() = 1
}
interface C : T {
fun getX() = 1
}
@@ -0,0 +1,11 @@
interface T1 {
fun getX() = 1
}
interface T2 {
val x: Int
get() = 1
}
class C : T1, T2 {
}
@@ -0,0 +1,8 @@
fun foo(vararg x: Int) {}
fun foo(x: IntArray) {}
fun foo(vararg x: Int?) {}
fun foo(x: Array<Int>) {}
fun foo(vararg nn: Number) {}
fun foo(nn: Array<out Number>) {}