[Spec tests] Add diagnostics tests for building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver

This commit is contained in:
anastasiia.spaseeva
2020-03-19 16:28:17 +03:00
committed by Victor Petukhov
parent 81b6e5a373
commit 3b35374186
29 changed files with 1291 additions and 117 deletions
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 2
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 6
* NUMBER: 1
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 4
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 9
* NUMBER: 10
@@ -13,6 +13,7 @@
// FILE: KotlinLib.kt
package test.lib
class MyClass {
//property-like (II prio)
companion object foo {
@@ -28,11 +29,12 @@ package overloadResolution
import test.lib.MyClass.foo as boo
//function-like (I prio)
class boo(){}
open class A()
class boo() : A() {}
fun box(): String {
val x = boo()
if (x is boo && !test.lib.MyClass.fooCompanionObj)
val x: Any = boo()
if (x !is A && test.lib.MyClass.fooCompanionObj)
return "OK"
return "NOK"
}
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 6
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 3
* NUMBER: 2
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 2
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 10
* NUMBER: 4
@@ -28,7 +28,7 @@ fun box(): String {
boo(1)
if (!test.lib.isFooCalled && isBooCalled)
if (test.lib.isFooCalled && !isBooCalled)
return "OK"
return "NOK"
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 2
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 7
* NUMBER: 5
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 2
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 7
* NUMBER: 6
@@ -32,7 +32,7 @@ fun foo() { fooFun = true }
fun box(): String {
foo()
if (!test.lib.isMarker && fooFun)
if (test.lib.isMarker && !fooFun)
return "OK"
return "NOK"
}
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 2
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 7
* NUMBER: 7
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 2
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 8
* NUMBER: 8
@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* SPEC VERSION: 0.1-268
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 5 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 2
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 8
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 10
@@ -34,7 +34,7 @@ fun boo() { booFun = true }
fun box(): String {
boo()
if (booFun && !test.lib.MyClass.fooCompanionObj)
if (!booFun && test.lib.MyClass.fooCompanionObj)
return "OK"
return "NOK"
}
@@ -1,30 +0,0 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-253
* PLACE: overload-resolution, callables-and-invoke-convention -> paragraph 6 -> sentence 1
* RELEVANT PLACES: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 4
* overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 6
* NUMBER: 3
* DESCRIPTION: function-like prio is higher than property-like callables
*/
class foo(val a: Int)
var fooLambda: Boolean = false
val foo: (Int) -> Unit = { a: Int -> fooLambda = true }
fun box(): String {
val x = foo(1)
if (x is foo && !fooLambda)
return "OK"
return "NOK"
}
@@ -1,63 +1,57 @@
{
"6": {
"5": {
"pos": {
"1": [
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"unexpectedBehaviour": false
@@ -69,77 +63,70 @@
"pos": {
"2": [
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.6.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.6.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.7.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.7.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.8.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.8.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.9.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.9.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.4.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.4.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.5.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.5.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.1.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.1.kt",
"unexpectedBehaviour": false
}
],
"6": [
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.2.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.2.kt",
"unexpectedBehaviour": false
}
],
"4": [
{
"specVersion": "0.1-253",
"specVersion": "0.1-268",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.3.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-253",
"casesNumber": 0,
"description": "function-like prio is higher than property-like callables",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-6/pos/1.10.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/callables-and-invoke-convention/p-5/pos/1.10.kt",
"unexpectedBehaviour": false
}
]