[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,57 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !WITH_NEW_INFERENCE
@Target(AnnotationTarget.TYPE)
@DslMarker
annotation class MyDsl
interface A {
fun foo()
}
interface B {
fun bar()
}
fun baz1(x: (@MyDsl A).() -> Unit) {}
fun baz2(x: (@MyDsl B).() -> Unit) {}
fun baz3(x: @MyDsl A.() -> Unit) {}
fun baz4(x: @MyDsl B.() -> Unit) {}
fun @MyDsl A.baz5() {
baz4 {
bar()
foo()
}
}
fun main() {
baz1 {
baz2 {
bar()
foo()
}
}
baz3 {
baz2 {
bar()
foo()
}
}
baz1 {
baz4 {
bar()
foo()
}
}
baz3 {
baz4 {
bar()
foo()
}
}
}
@@ -0,0 +1,58 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !LANGUAGE: +DslMarkerOnFunctionTypeReceiver
// !WITH_NEW_INFERENCE
@Target(AnnotationTarget.TYPE)
@DslMarker
annotation class MyDsl
interface A {
fun foo()
}
interface B {
fun bar()
}
fun baz1(x: (@MyDsl A).() -> Unit) {}
fun baz2(x: (@MyDsl B).() -> Unit) {}
fun baz3(x: @MyDsl A.() -> Unit) {}
fun baz4(x: @MyDsl B.() -> Unit) {}
fun @MyDsl A.baz5() {
baz4 {
bar()
foo()
}
}
fun main() {
baz1 {
baz2 {
bar()
foo()
}
}
baz3 {
baz2 {
bar()
foo()
}
}
baz1 {
baz4 {
bar()
foo()
}
}
baz3 {
baz4 {
bar()
foo()
}
}
}
@@ -0,0 +1,26 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun <T> foo(x: T.() -> Unit) {}
fun <E> bar(x: E.() -> Unit) {}
fun test() {
foo<@Ann A> {
a()
bar<@Ann B> {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,28 @@
@DslMarker
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPEALIAS)
annotation class XMarker
@XMarker
class Foo
class Bar
@XMarker
typealias XBar = Bar
typealias XXBar = XBar
fun Foo.foo(body: Foo.() -> Unit) = <!INAPPLICABLE_CANDIDATE!>body<!>()
fun Foo.xbar(body: XBar.() -> Unit) = Bar().<!UNRESOLVED_REFERENCE!>body<!>()
fun Foo.xxbar(body: XXBar.() -> Unit) = Bar().<!UNRESOLVED_REFERENCE!>body<!>()
fun test() {
Foo().foo {
<!UNRESOLVED_REFERENCE!>xbar<!> {
<!UNRESOLVED_REFERENCE!>foo<!> {}
}
<!UNRESOLVED_REFERENCE!>xxbar<!> {
<!UNRESOLVED_REFERENCE!>foo<!> {}
}
}
}
@@ -0,0 +1,24 @@
// !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE
@DslMarker
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPEALIAS)
annotation class XMarker
@XMarker
class Foo
class Bar
typealias YBar = ZBar
typealias ZBar = <!OTHER_ERROR!>YBar<!>
fun Foo.foo(body: Foo.() -> Unit) = <!INAPPLICABLE_CANDIDATE!>body<!>()
fun Foo.zbar(body: ZBar.() -> Unit) = Bar().<!UNRESOLVED_REFERENCE!>body<!>()
fun test() {
Foo().foo {
<!UNRESOLVED_REFERENCE!>zbar<!> {
<!UNRESOLVED_REFERENCE!>foo<!> {}
}
}
}
@@ -0,0 +1,30 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
interface Common
interface C : Common
interface D : C
class A : C {
fun a() = 1
}
class B : D {
fun b() = 2
}
fun foo(x: A.() -> Unit) {}
fun bar(x: B.() -> Unit) {}
fun test() {
foo {
a()
bar {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,23 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
class A {
fun a() = 1
}
@Ann
class B {
fun b() = 2
}
fun bar(x: B.() -> Unit) {}
fun A.test() {
bar {
a()
this@test.a()
b()
}
}
@@ -0,0 +1,22 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun bar(x: (@Ann B).() -> Unit) {}
fun @Ann A.test() {
bar {
a()
this@test.a()
b()
}
}
@@ -0,0 +1,19 @@
@DslMarker
annotation class MyDsl
@MyDsl
interface Foo<T> {
val x: Int
}
val Foo<*>.bad: Int get() = x
fun Foo<*>.badFun(): Int = x
val Foo<Int>.good: Int get() = x
fun test(foo: Foo<*>) {
foo.apply {
x
}
}
@@ -0,0 +1,25 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class MyDsl
@MyDsl
interface Scope<A, B> {
val something: A
val value: B
}
fun scoped1(block: Scope<Int, String>.() -> Unit) {}
fun scoped2(block: Scope<*, String>.() -> Unit) {}
val <T> Scope<*, T>.property: T get() = value
fun f() {
scoped1 {
value
property
}
scoped2 {
value
property
}
}
@@ -0,0 +1,11 @@
@DslMarker
annotation class AnnMarker
@AnnMarker
class Inv<T> {
fun bar() {}
}
fun Inv<*>.foo() {
bar()
}
@@ -0,0 +1,93 @@
// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class L1
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class L2
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun foo1(x: (@L1 A).() -> Unit) {}
fun foo2(x: (@L2 A).() -> Unit) {}
fun foo12(x: (@L1 @L2 A).() -> Unit) {}
fun bar1(x: (@L1 B).() -> Unit) {}
fun bar2(x: (@L2 B).() -> Unit) {}
fun <T> bar1t(q: T, x: (@L1 T).() -> Unit) {}
fun test() {
foo12 {
a()
bar1 {
a()
b()
}
bar2 {
a()
b()
}
}
bar1 {
b()
foo12 {
a()
b()
}
}
bar2 {
b()
foo12 {
a()
b()
}
}
foo2 {
bar1t(this) {
a()
bar1 {
a()
b()
}
bar2 {
a()
b()
}
}
}
bar1 {
b()
foo2 {
bar1t(this) {
a()
b()
}
}
}
bar2 {
b()
foo2 {
bar1t(this) {
a()
b()
}
}
}
}
@@ -0,0 +1,40 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun foo(x: (@Ann A).() -> Unit) {}
fun bar(x: (@Ann B).() -> Unit) {}
fun test() {
foo {
a()
foo l1@{
a()
bar l2@{
a()
this@l1.a()
b()
foo l3@{
a()
b()
this@l2.b()
bar {
a()
this@l3.a()
b()
}
}
}
}
}
}
@@ -0,0 +1,62 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
class A {
var a = 1
}
var A.a1: Int
get() = 1
set(value) {}
@Ann
class B {
var b = 2
}
var B.b1: Int
get() = 1
set(value) {}
fun foo(x: A.() -> Unit) {}
fun bar(x: B.() -> Unit) {}
fun test() {
foo {
a + 1
a += a + 1
a++
a1 + 1
a1 += a1 + 1
a1++
bar {
a + 1
a += a + 1
a++
a1 + 1
a1 += a1 + 1
a1++
this@foo.a + 1
this@foo.a += this@foo.a + 1
this@foo.a++
this@foo.a1 + 1
this@foo.a1 += this@foo.a1 + 1
this@foo.a1++
b + 1
b += b + 1
b++
b1 + 1
b1 += b1 + 1
b1++
}
}
}
@@ -0,0 +1,27 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
class A {
fun a() = 1
}
@Ann
class B {
fun b() = 2
}
fun foo(x: A.() -> Unit) {}
fun bar(x: B.() -> Unit) {}
fun test() {
foo {
a()
bar {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,26 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun foo(x: (@Ann A).() -> Unit) {}
fun bar(x: (@Ann B).() -> Unit) {}
fun test() {
foo {
a()
bar {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,27 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
class A {
fun a() = 1
}
@Ann
class B {
fun b() = 2
}
fun <T> foo(x: T.() -> Unit) {}
fun <E> bar(x: E.() -> Unit) {}
fun test() {
foo<A> {
a()
bar<B> {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,27 @@
// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun <T> foo(x: (@Ann T).() -> Unit) {}
fun <E> bar(x: (@Ann E).() -> Unit) {}
fun test() {
foo<A> {
a()
bar<B> {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,111 @@
// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann1
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann2
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann3
class A {
operator fun B.invoke() {}
val B.y: D get() = D()
}
class B
class C {
operator fun D.invoke() {}
val D.x: B get() = B()
}
class D
fun foo(x: (@Ann1 A).() -> Unit) {}
fun bar(x: (@Ann2 B).() -> Unit) {}
fun baz(x: (@Ann3 C).() -> Unit) {}
fun foo1(x: (@Ann1 D).() -> Unit) {}
fun foo2(x: (@Ann2 D).() -> Unit) {}
fun foo3(x: (@Ann3 D).() -> Unit) {}
fun test() {
foo {
bar {
baz {
y()
<!UNRESOLVED_REFERENCE!>x<!>()
with(D()) {
x()
}
D().x()
foo1 {
x()
y()
with(A()) {
x()
y()
}
with(D()) {
x()
}
D().x()
}
foo2 {
x()
y()
}
foo3 {
x()
y()
}
}
}
}
foo1 {
foo {
baz {
bar {
x()
y()
}
}
}
}
foo2 {
foo {
baz {
bar {
x()
y()
}
}
}
}
foo3 {
foo {
baz {
bar {
x()
y()
}
}
}
}
}
@@ -0,0 +1,106 @@
// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann1
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann2
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann3
class A {
val B.y: (C.() -> Unit) get() = null!!
}
class B
class C {
val D.x: (A.() -> Unit) get() = null!!
}
class D
fun foo(x: (@Ann1 A).() -> Unit) {}
fun bar(x: (@Ann2 B).() -> Unit) {}
fun baz(x: (@Ann3 C).() -> Unit) {}
fun foo1(x: (@Ann1 D).() -> Unit) {}
fun foo2(x: (@Ann2 D).() -> Unit) {}
fun foo3(x: (@Ann3 D).() -> Unit) {}
fun test() {
foo {
bar {
baz {
<!INAPPLICABLE_CANDIDATE!>y<!>()
<!UNRESOLVED_REFERENCE!>x<!>()
with(D()) {
<!INAPPLICABLE_CANDIDATE!>x<!>()
}
foo1 {
<!INAPPLICABLE_CANDIDATE!>x<!>()
<!INAPPLICABLE_CANDIDATE!>y<!>()
with(A()) {
<!INAPPLICABLE_CANDIDATE!>x<!>()
<!INAPPLICABLE_CANDIDATE!>y<!>()
}
with(D()) {
<!INAPPLICABLE_CANDIDATE!>x<!>()
}
A().<!UNRESOLVED_REFERENCE!>x<!>()
}
foo2 {
<!INAPPLICABLE_CANDIDATE!>x<!>()
<!INAPPLICABLE_CANDIDATE!>y<!>()
}
foo3 {
<!INAPPLICABLE_CANDIDATE!>x<!>()
<!INAPPLICABLE_CANDIDATE!>y<!>()
}
}
}
}
foo1 {
foo {
baz {
bar {
<!INAPPLICABLE_CANDIDATE!>x<!>()
<!INAPPLICABLE_CANDIDATE!>y<!>()
}
}
}
}
foo2 {
foo {
baz {
bar {
<!INAPPLICABLE_CANDIDATE!>x<!>()
<!INAPPLICABLE_CANDIDATE!>y<!>()
}
}
}
}
foo3 {
foo {
baz {
bar {
<!INAPPLICABLE_CANDIDATE!>x<!>()
<!INAPPLICABLE_CANDIDATE!>y<!>()
}
}
}
}
}
@@ -0,0 +1,102 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann1
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann2
class A {
fun D.extA() {}
}
class B {
fun D.extB() {}
}
class D
fun foo(x: (@Ann1 A).() -> Unit) {}
fun bar(x: (@Ann2 B).() -> Unit) {}
fun baz(x: (@Ann1 D).() -> Unit) {}
fun test() {
foo {
bar {
baz {
extA()
extB()
D().extA()
D().extB()
with(D()) {
extA()
extB()
}
}
}
}
foo {
baz {
extA()
D().extA()
bar {
extA()
extB()
D().extA()
D().extB()
with(D()) {
extA()
extB()
}
}
}
}
baz {
foo {
extA()
D().extA()
bar {
extA()
extB()
D().extA()
D().extB()
with(D()) {
extA()
extB()
}
}
}
}
baz {
bar {
extB()
D().extB()
foo {
extA()
extB()
D().extA()
D().extB()
with(D()) {
extA()
extB()
}
}
}
}
}
@@ -0,0 +1,104 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class L1
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class L2
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun foo1(x: (@L1 A).() -> Unit) {}
fun foo2(x: (@L2 A).() -> Unit) {}
fun bar1(x: (@L1 B).() -> Unit) {}
fun bar2(x: (@L2 B).() -> Unit) {}
fun test() {
foo1 {
a()
foo2 {
a()
bar1 {
a()
b()
bar2 {
a()
b()
}
}
bar2 {
a()
b()
}
}
bar1 {
a()
b()
bar2 {
a()
b()
}
}
bar2 {
a()
b()
}
}
foo2 {
a()
bar1 {
a()
b()
bar2 {
a()
b()
}
}
bar2 {
a()
b()
}
}
bar1 {
b()
bar2 {
b()
}
}
bar2 {
b()
}
foo1 {
bar1 {
a()
b()
foo2 {
a()
b()
bar2 {
a()
b()
}
}
}
}
}
@@ -0,0 +1,28 @@
// !LANGUAGE: -DslMarkersSupport
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
class A {
fun a() = 1
}
@Ann
class B {
fun b() = 2
}
fun foo(x: A.() -> Unit) {}
fun bar(x: B.() -> Unit) {}
fun test() {
foo {
a()
bar {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,27 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
class A
fun A.a() = 1
@Ann
class B
fun B.b() = 2
fun foo(x: A.() -> Unit) {}
fun bar(x: B.() -> Unit) {}
fun test() {
foo {
a()
bar {
a()
this@foo.a()
b()
}
}
}
@@ -0,0 +1,24 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
annotation class Ann
@Ann
class A {
fun a() = 1
}
@Ann
class B {
fun b() = 2
}
fun test(a: A, b: B) {
with(a) l1@{
a()
with(b) {
a()
this@l1.a()
b()
}
}
}
@@ -0,0 +1,30 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
@DslMarker
@Target(AnnotationTarget.TYPE)
annotation class Ann
class A {
fun a() = 1
}
class B {
fun b() = 2
}
fun foo(x: (@Ann A).() -> Unit) {}
fun bar(x: (@Ann B).() -> Unit) {}
fun test() {
foo {
with(this) l1@{
a()
bar {
with(this) {
a()
this@l1.a()
b()
}
}
}
}
}