FIR: Adjust testData for spec tests: infix priority
^KT-37374 Please, fix the tests
This commit is contained in:
+123
@@ -0,0 +1,123 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-300
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-with-trailing-lambda-expressions -> paragraph 1 -> sentence 2
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 1
|
||||
* NUMBER: 17
|
||||
* DESCRIPTION: Infix fun: Local extension infix extension callables
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 0, 1, 2, 3, 4
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
class A() {
|
||||
infix fun foo(x: ()->Int) = "member fun foo"
|
||||
}
|
||||
|
||||
// FILE: Extensions.kt
|
||||
// TESTCASE NUMBER: 0
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
infix fun A.foo(x: ()->Int) = "pack scope extension fun foo"
|
||||
|
||||
// FILE: TestCase1.kt
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
class Case1() {
|
||||
infix fun A.foo(x: ()->Int) = "local extension fun foo"
|
||||
|
||||
fun case1() {
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo {1}<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo {1}<!>
|
||||
}
|
||||
}
|
||||
// FILE: TestCase2.kt
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
interface Case2 {
|
||||
infix fun A.foo(x: ()->Int) = "local extension fun foo"
|
||||
|
||||
fun case2() {
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo {1}<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo {1}<!>
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: TestCase3.kt
|
||||
// TESTCASE NUMBER: 3
|
||||
package testPack
|
||||
import libPackage.A
|
||||
|
||||
infix fun A.foo(x: ()->Int) = "my package scope top level trim"
|
||||
|
||||
|
||||
fun case3() {
|
||||
infix fun A.foo(x: ()->Int) = "my local scope trim"
|
||||
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo {1}<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo {1}<!>
|
||||
}
|
||||
|
||||
// FILE: TestCase4.kt
|
||||
// TESTCASE NUMBER: 4
|
||||
package testPackNew
|
||||
import libPackage.A
|
||||
|
||||
infix fun A.foo(x: ()->Int) = "my package scope top level trim"
|
||||
|
||||
|
||||
fun case4() {
|
||||
|
||||
infix fun A.foo(x: ()->Int) = "my local trim"
|
||||
|
||||
fun subfun() {
|
||||
infix fun A.foo(x: ()->Int) = "my local trim"
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo {1}<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo {1}<!>
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: TestCase5.kt
|
||||
// TESTCASE NUMBER: 5
|
||||
package testPackNew
|
||||
|
||||
class A() {
|
||||
fun foo(i: ()->Int) {}
|
||||
infix fun A.foo(i: ()->Int) {}
|
||||
|
||||
fun bar(a: A) {
|
||||
//todo: add info if function is infix one
|
||||
<!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: function")!>a foo {1}<!>
|
||||
}
|
||||
|
||||
fun buz(a: A) {
|
||||
fun foo(i: ()->Int) {}
|
||||
//todo: add info if function is infix one
|
||||
<!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: function")!>a foo {1}<!>
|
||||
}
|
||||
|
||||
fun boo(a: A) {
|
||||
infix fun A.foo(i: ()->Int) {}
|
||||
<!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: function")!>a foo {1}<!>
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -EXTENSION_SHADOWED_BY_MEMBER
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-313
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Implicitly imported extension callable without infix modifier
|
||||
*/
|
||||
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
class A() {
|
||||
fun foo(x: Int) = "member fun foo"
|
||||
}
|
||||
|
||||
// FILE: Extensions.kt
|
||||
// TESTCASE NUMBER: 1, 2, 3, 4
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
fun A.foo(x: Int) = "pack scope extension fun foo"
|
||||
|
||||
// FILE: TestCase1.kt
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
class Case1() {
|
||||
fun A.foo(x: Int) = "local extension fun foo"
|
||||
|
||||
fun case1() {
|
||||
val a = A()
|
||||
a foo 1
|
||||
A() foo 1
|
||||
}
|
||||
}
|
||||
// FILE: TestCase2.kt
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
interface Case2 {
|
||||
fun A.foo(x: Int) = "local extension fun foo"
|
||||
|
||||
fun case2() {
|
||||
val a = A()
|
||||
a foo 1
|
||||
A() foo 1
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: TestCase3.kt
|
||||
// TESTCASE NUMBER: 3
|
||||
package testPack
|
||||
import libPackage.A
|
||||
|
||||
fun A.foo(x: Int) = "my package scope top level contains"
|
||||
|
||||
|
||||
fun case3() {
|
||||
fun A.foo(x: Int) ="my local scope contains"
|
||||
|
||||
val a = A()
|
||||
a foo 1
|
||||
A() foo 1
|
||||
}
|
||||
|
||||
// FILE: TestCase4.kt
|
||||
// TESTCASE NUMBER: 4
|
||||
package testPackNew
|
||||
import libPackage.A
|
||||
|
||||
fun A.foo(x: Int) = "my package scope top level contains"
|
||||
|
||||
|
||||
fun case4() {
|
||||
|
||||
fun A.foo(x: Int) = "my local contains"
|
||||
|
||||
fun subfun() {
|
||||
fun A.foo(x: Int) = "my local contains"
|
||||
val a = A()
|
||||
a foo 1
|
||||
A() foo 1
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-313
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 2
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Local extension infix extension callables
|
||||
*/
|
||||
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my contains")
|
||||
return true
|
||||
}
|
||||
// FILE: Extensions.kt
|
||||
|
||||
package sentence3
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope contains")
|
||||
return true
|
||||
}
|
||||
|
||||
// FILE: TestCase1.kt
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
package sentence3
|
||||
import libPackage.contains
|
||||
|
||||
class Case1() {
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my local class scope contains")
|
||||
return true
|
||||
}
|
||||
|
||||
fun case1() {
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
}
|
||||
// FILE: TestCase2.kt
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
package sentence3
|
||||
import libPackage.contains
|
||||
|
||||
interface Case2 {
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my local interface scope contains")
|
||||
return true
|
||||
}
|
||||
|
||||
fun case2() {
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: TestCase3.kt
|
||||
// TESTCASE NUMBER: 3
|
||||
package testPack
|
||||
import libPackage.contains
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope top level contains")
|
||||
return true
|
||||
}
|
||||
|
||||
fun case3() {
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope top level contains")
|
||||
return true
|
||||
}
|
||||
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
|
||||
// FILE: TestCase4.kt
|
||||
// TESTCASE NUMBER: 4
|
||||
package testPackNew
|
||||
import libPackage.contains
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope top level contains")
|
||||
return true
|
||||
}
|
||||
|
||||
fun case4() {
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my local contains")
|
||||
return true
|
||||
}
|
||||
|
||||
fun subfun() {
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my local contains")
|
||||
return true
|
||||
}
|
||||
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-313
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 3
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Explicitly imported infix extension callables
|
||||
*/
|
||||
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my contains")
|
||||
return true
|
||||
}
|
||||
// FILE: Extensions.kt
|
||||
|
||||
package sentence3
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope contains")
|
||||
return true
|
||||
}
|
||||
|
||||
// FILE: TestCase1.kt
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
package sentence3
|
||||
import libPackage.contains
|
||||
|
||||
|
||||
fun case1() {
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
|
||||
// FILE: TestCase2.kt
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
package sentence3
|
||||
import libPackage.contains
|
||||
|
||||
|
||||
fun case2() {
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my local contains")
|
||||
return true
|
||||
}
|
||||
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-313
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 4
|
||||
* NUMBER: 4
|
||||
* DESCRIPTION: Star-imported infix extension callables
|
||||
*/
|
||||
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my contains")
|
||||
return true
|
||||
}
|
||||
// FILE: Extensions.kt
|
||||
|
||||
package sentence3
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope contains")
|
||||
return true
|
||||
}
|
||||
|
||||
// FILE: TestCase1.kt
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
package sentence3
|
||||
import libPackage.*
|
||||
|
||||
|
||||
fun case1() {
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
|
||||
// FILE: TestCase2.kt
|
||||
// TESTCASE NUMBER: 2
|
||||
package testPack
|
||||
import libPackage.*
|
||||
|
||||
operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope top level contains")
|
||||
return true
|
||||
}
|
||||
|
||||
fun case2() {
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-313
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 4
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 5
|
||||
* NUMBER: 5
|
||||
* DESCRIPTION: Star-imported extension callable only
|
||||
*/
|
||||
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
private infix operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my contains")
|
||||
return true
|
||||
}
|
||||
|
||||
// FILE: TestCase2.kt
|
||||
package sentence3
|
||||
import libPackage.* //nothing to import, extension is private
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case1() {
|
||||
val regex = Regex("")
|
||||
"" contains regex
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-313
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 4
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Local extension infix extension callables
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 0, 1, 2, 3, 4
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
class A() {
|
||||
infix fun foo(x: Int) = "member fun foo"
|
||||
}
|
||||
|
||||
// FILE: Extensions.kt
|
||||
// TESTCASE NUMBER: 0
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
infix fun A.foo(x: Int) = "pack scope extension fun foo"
|
||||
|
||||
// FILE: TestCase1.kt
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
class Case1() {
|
||||
infix fun A.foo(x: Int) = "local extension fun foo"
|
||||
|
||||
fun case1() {
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo 1<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo 1<!>
|
||||
}
|
||||
}
|
||||
// FILE: TestCase2.kt
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
package sentence3
|
||||
import libPackage.A
|
||||
|
||||
interface Case2 {
|
||||
infix fun A.foo(x: Int) = "local extension fun foo"
|
||||
|
||||
fun case2() {
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo 1<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo 1<!>
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: TestCase3.kt
|
||||
// TESTCASE NUMBER: 3
|
||||
package testPack
|
||||
import libPackage.A
|
||||
|
||||
infix fun A.foo(x: Int) = "my package scope top level contains"
|
||||
|
||||
|
||||
fun case3() {
|
||||
infix fun A.foo(x: Int) = "my local scope contains"
|
||||
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo 1<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo 1<!>
|
||||
}
|
||||
|
||||
// FILE: TestCase4.kt
|
||||
// TESTCASE NUMBER: 4
|
||||
package testPackNew
|
||||
import libPackage.A
|
||||
|
||||
infix fun A.foo(x: Int) = "my package scope top level contains"
|
||||
|
||||
|
||||
fun case4() {
|
||||
|
||||
infix fun A.foo(x: Int) = "my local contains"
|
||||
|
||||
fun subfun() {
|
||||
infix fun A.foo(x: Int) = "my local contains"
|
||||
val a = A()
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>a foo 1<!>
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.A.foo; typeCall: infix function")!>A() foo 1<!>
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: TestCase5.kt
|
||||
// TESTCASE NUMBER: 5
|
||||
package testPackNew
|
||||
|
||||
class A() {
|
||||
fun foo(i: Int) {}
|
||||
infix fun A.foo(i: Int) {}
|
||||
|
||||
fun bar(a: A) {
|
||||
//todo: add info if function is infix one
|
||||
<!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: function")!>a foo 1<!>
|
||||
}
|
||||
|
||||
fun buz(a: A){
|
||||
fun foo(i: Int) {}
|
||||
//todo: add info if function is infix one
|
||||
<!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: function")!>a foo 1<!>
|
||||
}
|
||||
|
||||
fun boo(a: A){
|
||||
infix fun A.foo(i: Int) {}
|
||||
<!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: function")!>a foo 1<!>
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-313
|
||||
* PLACE: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 4
|
||||
* RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 1
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, infix-function-call -> paragraph 2 -> sentence 2
|
||||
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 3
|
||||
*
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Explicitly imported infix extension callables
|
||||
*/
|
||||
|
||||
// FILE: Extensions.kt
|
||||
package libPackage
|
||||
|
||||
infix operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my contains")
|
||||
return true
|
||||
}
|
||||
// FILE: Extensions.kt
|
||||
|
||||
package sentence3
|
||||
|
||||
infix operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my package scope contains")
|
||||
return true
|
||||
}
|
||||
|
||||
// FILE: TestCase1.kt
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
package sentence3
|
||||
import libPackage.contains
|
||||
|
||||
|
||||
fun case1() {
|
||||
val regex = Regex("")
|
||||
<!DEBUG_INFO_CALL("fqName: libPackage.contains; typeCall: infix operator extension function")!>"" contains regex<!>
|
||||
}
|
||||
|
||||
// FILE: TestCase2.kt
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
package sentence3
|
||||
import libPackage.contains
|
||||
|
||||
|
||||
fun case2() {
|
||||
infix operator fun CharSequence.contains(regex: Regex): Boolean {
|
||||
println("my local contains")
|
||||
return true
|
||||
}
|
||||
val regex = Regex("")
|
||||
<!DEBUG_INFO_CALL("fqName: sentence3.case2.contains; typeCall: infix operator extension function")!>"" contains regex<!>
|
||||
}
|
||||
Reference in New Issue
Block a user