Compare commits

...

10 Commits

Author SHA1 Message Date
anastasiia.spaseeva
38c0f01696 [Spec tests] Fix test cases structure 2020-06-29 21:36:28 +03:00
anastasiia.spaseeva
6162010bff [Spec tests] Add tests for subtyping rules for simple classifier type 2020-06-29 21:36:28 +03:00
anastasiia.spaseeva
f5c4159b13 [Spec tests] Add tests for inner-and-nested-type-contexts section 2020-06-29 21:36:27 +03:00
anastasiia.spaseeva
3f39be31b7 [Spec tests] Add overload resolution tests for plus assign
[Spec tests] Add tests for plus assign more 2 + fir + unexpected behaviour
2020-06-29 21:36:27 +03:00
anastasiia.spaseeva
dba9fd4284 [Spec tests] Actualize test for callable reference section 2020-06-29 21:36:27 +03:00
anastasiia.spaseeva
d2a091ab0f [Spec tests] Update spec version 2020-06-29 21:36:08 +03:00
anastasiia.spaseeva
809e5a0ad4 [Spec tests] Add tests for resolving callable references and some co-tests 2020-06-25 12:37:04 +03:00
anastasiia.spaseeva
ccb65ec0e0 [Spec tests] Add tests for Algorithm of MSC selection 2020-06-25 12:37:04 +03:00
anastasiia.spaseeva
2f0da8a7d9 [Spec tests] Add test for Coercion to Unit error diagnostics absence KT-38490 2020-06-25 12:37:04 +03:00
anastasiia.spaseeva
c8d7cc34c2 [Spec tests] Update spec testData 2020-06-25 12:37:03 +03:00
281 changed files with 17163 additions and 730 deletions

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 1
* DESCRIPTION: Simple real literals with an exponent mark.

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 2
* DESCRIPTION: Real literals suffixed by f/F (float suffix) with an exponent mark.

View File

@@ -137,7 +137,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "Real literals suffixed by f/F (float suffix) with an exponent mark.",
"path": "compiler/tests-spec/testData/codegen/box/linked/expressions/constant-literals/real-literals/p-2/pos/1.2.kt",
@@ -145,7 +145,7 @@
"linkType": "main"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "Simple real literals with an exponent mark.",
"path": "compiler/tests-spec/testData/codegen/box/linked/expressions/constant-literals/real-literals/p-2/pos/1.1.kt",

View File

@@ -3,7 +3,7 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-213
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 3
* NUMBER: 1
* DESCRIPTION: check equallity by refference via constructor

View File

@@ -53,7 +53,7 @@
],
"3": [
{
"specVersion": "0.1-213",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "check equallity by refference via constructor",
"path": "compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos/3.1.kt",

View File

@@ -0,0 +1,44 @@
{
"1": {
"neg": {
"2": [
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
]
},
"pos": {
"2": [
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
]
}
}
}

View File

@@ -0,0 +1 @@
java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.1.kt

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 1
* DESCRIPTION: nullable receiver
* EXCEPTION: compiletime
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b.plusAssign(c)
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
operator fun plusAssign(c: C) {
f1 = true
print("1")
}
operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
operator fun B.plusAssign(c: C) {
f3 = true
print("3")
}
operator fun B.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1 @@
java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign({ c }())' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.2.kt

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 2
* DESCRIPTION: nullable receiver
* EXCEPTION: compiletime
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += { c }()
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b.plusAssign({ c }())
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
operator fun plusAssign(c: C) {
f1 = true
print("1")
}
operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
operator fun B.plusAssign(c: C) {
f3 = true
print("3")
}
operator fun B.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1 @@
java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.3.kt

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 3
* DESCRIPTION: nullable receiver
* EXCEPTION: compiletime
*/
fun box(): String {
val a: A? = A(B())
val c: C? = C()
a?.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b.plusAssign(c)
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
operator fun plusAssign(c: C) {
f1 = true
print("1")
}
operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
operator fun B.plusAssign(c: C) {
f3 = true
print("3")
}
operator fun B.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1 @@
java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.4.kt

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 4
* DESCRIPTION: nullable receiver and infix functions
* EXCEPTION: compiletime
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b plusAssign c
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
infix operator fun plusAssign(c: C) {
f1 = true
print("1")
}
infix operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
infix operator fun B.plusAssign(c: C) {
f3 = true
print("3")
}
infix operator fun B.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1 @@
java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign({ c }())' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.5.kt

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 5
* DESCRIPTION: nullable receiver and infix functions
* EXCEPTION: compiletime
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += { c }()
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b plusAssign { c }()
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
infix operator fun plusAssign(c: C) {
f1 = true
print("1")
}
infix operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
infix operator fun B.plusAssign(c: C) {
f3 = true
print("3")
}
infix operator fun B.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1 @@
java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.6.kt

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 6
* DESCRIPTION: nullable receiver and infix functions
* EXCEPTION: compiletime
*/
fun box(): String {
val a: A? = A(B())
val c: C? = C()
a?.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b plusAssign c
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
infix operator fun plusAssign(c: C) {
f1 = true
print("1")
}
infix operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
infix operator fun B.plusAssign(c: C) {
f3 = true
print("3")
}
infix operator fun B.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 1
* DESCRIPTION: nullable receiver
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b.plusAssign(c)
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
operator fun plusAssign(c: C) {
f1 = true
print("1")
}
operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
operator fun B?.plusAssign(c: C) {
f3 = true
print("3")
}
operator fun B?.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,64 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 10
* DESCRIPTION: nullable receiver and inline operator function
*/
fun cc() : C = C()
fun box(): String {
val a: A? = A(B())
a!!.b += ::cc
if (!f3 && f1 && !f2 && !f4) {
f1 = false
a!!.b.plusAssign(::cc)
if (f1 && !f3 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
inline operator fun plusAssign(c: ()->C) {
f1 = true
print("1")
}
inline operator fun plus(c: ()->C): C {
f2 = true
print("2")
return c()
}
}
@JvmName("aa")
inline operator fun B?.plusAssign(c: ()->C) {
f3 = true
print("3")
}
@JvmName("bb")
inline operator fun B?.plusAssign(c: ()->Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,62 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 2
* DESCRIPTION: nullable receiver
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += { c }()
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b.plusAssign({ c }())
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
operator fun plusAssign(c: C) {
f1 = true
print("1")
}
operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
operator fun B?.plusAssign(c: C) {
f3 = true
print("3")
}
operator fun B?.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 4
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 3
* DESCRIPTION: nullable receiver
*/
fun box(): String {
val a: A? = A(B())
val c: C? = C()
a!!.b += c?: C()
if (f1 && !f3 && !f2 && !f4) {
f3 = false
a!!.b.plusAssign(c?: C())
if (f1 && !f3 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
operator fun plusAssign(c: C) {
f1 = true
print("1")
}
operator fun plus(c: C?): C {
f2 = true
print("2")
return c!!
}
}
operator fun B?.plusAssign(c: C?) {
f3 = true
print("3")
}
operator fun B?.plusAssign(c: Any?) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,73 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 4
* DESCRIPTION: nullable receiver
*/
fun box(): String {
val a: A? = A(B())
val c: C? = C()
a!!.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b.plusAssign(c)
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
var f5 = false
var f6 = false
class B {
operator fun plusAssign(c: C) {
f1 = true
print("1")
}
operator fun plus(c: C?): C {
f2 = true
print("2")
return c!!
}
}
operator fun B?.plusAssign(c: C?) {
f5 = true
print("5")
}
operator fun B?.plusAssign(c: Any?) {
f6 = true
print("6")
}
@JvmName("aa")
operator fun B.plusAssign(c: C?) {
f3 = true
print("3")
}
@JvmName("bb")
operator fun B.plusAssign(c: Any?) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 5
* DESCRIPTION: nullable receiver and infix functions
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b plusAssign c
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
infix operator fun plusAssign(c: C) {
f1 = true
print("1")
}
infix operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
infix operator fun B?.plusAssign(c: C) {
f3 = true
print("3")
}
infix operator fun B?.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,62 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 6
* DESCRIPTION: nullable receiver and infix functions
*/
fun box(): String {
val a: A? = A(B())
val c: C = C()
a?.b += { c }()
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b plusAssign { c }()
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
infix operator fun plusAssign(c: C) {
f1 = true
print("1")
}
infix operator fun plus(c: C): C {
f2 = true
print("2")
return c
}
}
infix operator fun B?.plusAssign(c: C) {
f3 = true
print("3")
}
infix operator fun B?.plusAssign(c: Any) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,61 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 4
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 7
* DESCRIPTION: nullable receiver and infix functions
*/
fun box(): String {
val a: A? = A(B())
val c: C? = C()
a!!.b += c?: C()
if (f1 && !f3 && !f2 && !f4) {
f3 = false
a!!.b plusAssign (c?: C())
if (f1 && !f3 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
infix operator fun plusAssign(c: C) {
f1 = true
print("1")
}
infix operator fun plus(c: C?): C {
f2 = true
print("2")
return c!!
}
}
infix operator fun B?.plusAssign(c: C?) {
f3 = true
print("3")
}
infix operator fun B?.plusAssign(c: Any?) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,73 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 8
* DESCRIPTION: nullable receiver
*/
fun box(): String {
val a: A? = A(B())
val c: C? = C()
a!!.b += c
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b plusAssign c
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
var f5 = false
var f6 = false
class B {
infix operator fun plusAssign(c: C) {
f1 = true
print("1")
}
infix operator fun plus(c: C?): C {
f2 = true
print("2")
return c!!
}
}
infix operator fun B?.plusAssign(c: C?) {
f5 = true
print("5")
}
infix operator fun B?.plusAssign(c: Any?) {
f6 = true
print("6")
}
@JvmName("aa")
infix operator fun B.plusAssign(c: C?) {
f3 = true
print("3")
}
@JvmName("bb")
infix operator fun B.plusAssign(c: Any?) {
f4 = true
print("4")
}
class C

View File

@@ -0,0 +1,64 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-488
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2
* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3
* SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 2
* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3
* NUMBER: 9
* DESCRIPTION: nullable receiver and inline operator function
*/
fun cc() : C = C()
fun box(): String {
val a: A? = A(B())
a?.b += ::cc
if (f3 && !f1 && !f2 && !f4) {
f3 = false
a?.b.plusAssign(::cc)
if (f3 && !f1 && !f2 && !f4)
return "OK"
}
return "NOK"
}
class A(val b: B)
var f1 = false
var f2 = false
var f3 = false
var f4 = false
class B {
inline operator fun plusAssign(c: ()->C) {
f1 = true
print("1")
}
inline operator fun plus(c: ()->C): C {
f2 = true
print("2")
return c()
}
}
@JvmName("aa")
inline operator fun B?.plusAssign(c: ()->C) {
f3 = true
print("3")
}
@JvmName("bb")
inline operator fun B?.plusAssign(c: ()->Any) {
f4 = true
print("4")
}
class C

View File

@@ -1,4 +1,142 @@
{
"1": {
"neg": {
"2": [
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
]
},
"pos": {
"2": [
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
]
}
},
"2": {
"pos": {
"3": [

View File

@@ -0,0 +1,27 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-435
* MAIN LINK: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1
* NUMBER: 1
* DESCRIPTION: If both X_k and Y_k are built-in integer types, a type constraint Widen(X_k) <:Widen(Y_k) is built
*/
var flag = false
fun box(): String {
Case(1, 1)
if (flag) {
return "OK"
}else
return "NOK"
}
class Case {
constructor(y: Int, x: Number){
flag = false
}
constructor(vararg x: Int){
flag = true
}
}

View File

@@ -0,0 +1,25 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-435
* MAIN LINK: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1
* NUMBER: 2
* DESCRIPTION: If both X_k and Y_k are built-in integer types, a type constraint Widen(X_k) <:Widen(Y_k) is built
*/
var flag = false
fun box(): String {
Case(1, 1)
if (flag) {
return "OK"
}else
return "NOK"
}
class Case (val y: Int, val x: Number) {
constructor(vararg x: Int) : this(1, 1 as Number){
flag = true
}
}

View File

@@ -0,0 +1,108 @@
{
"3": {
"pos": {
"1": [
{
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "If both X_k and Y_k are built-in integer types, a type constraint Widen(X_k) \u003c:Widen(Y_k) is built",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos/1.2.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "If both X_k and Y_k are built-in integer types, a type constraint Widen(X_k) \u003c:Widen(Y_k) is built",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
],
"3": [
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"4": [
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
]
}
}
}

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-268
* MAIN LINK: overload-resolution, receivers -> paragraph 5 -> sentence 2
* SPEC VERSION: 0.1-435
* MAIN LINK: overload-resolution, receivers -> paragraph 6 -> sentence 2
* NUMBER: 1
* DESCRIPTION: implicit this receiver has higher priority than any companion object receiver
*/

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-268
* MAIN LINK: overload-resolution, receivers -> paragraph 5 -> sentence 2
* SPEC VERSION: 0.1-435
* MAIN LINK: overload-resolution, receivers -> paragraph 6 -> sentence 2
* NUMBER: 2
* DESCRIPTION: implicit this receiver has higher priority than any companion object receiver
*/

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-278
* MAIN LINK: overload-resolution, receivers -> paragraph 5 -> sentence 3
* SPEC VERSION: 0.1-435
* MAIN LINK: overload-resolution, receivers -> paragraph 6 -> sentence 3
* NUMBER: 1
* DESCRIPTION: The phantom static implicit this receiver has higher priority than the current class companion object receiver;
*/

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-278
* MAIN LINK:overload-resolution, receivers -> paragraph 5 -> sentence 4
* SPEC VERSION: 0.1-435
* MAIN LINK:overload-resolution, receivers -> paragraph 6 -> sentence 4
* NUMBER: 2
* DESCRIPTION: Current class companion object receiver has higher priority than any of the superclass companion objects;
*/

View File

@@ -3,9 +3,9 @@
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-278
* MAIN LINK: overload-resolution, receivers -> paragraph 5 -> sentence 5
* PRIMARY LINKS: overload-resolution, receivers -> paragraph 5 -> sentence 4
* SPEC VERSION: 0.1-435
* MAIN LINK: overload-resolution, receivers -> paragraph 6 -> sentence 5
* PRIMARY LINKS: overload-resolution, receivers -> paragraph 6 -> sentence 4
* NUMBER: 1
* DESCRIPTION: Superclass companion object receivers are prioritized according to the inheritance order
*/

View File

@@ -1,58 +1,58 @@
{
"5": {
"6": {
"pos": {
"2": [
{
"specVersion": "0.1-268",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "implicit this receiver has higher priority than any companion object receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/2.1.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-6/pos/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-268",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "implicit this receiver has higher priority than any companion object receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/2.2.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-6/pos/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
],
"3": [
{
"specVersion": "0.1-278",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "The phantom static implicit this receiver has higher priority than the current class companion object receiver;",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.1.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-6/pos/3.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
],
"5": [
{
"specVersion": "0.1-278",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "Superclass companion object receivers are prioritized according to the inheritance order",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/5.1.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-6/pos/5.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
],
"4": [
{
"specVersion": "0.1-278",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "Superclass companion object receivers are prioritized according to the inheritance order",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/5.1.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-6/pos/5.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-278",
"specVersion": "0.1-435",
"casesNumber": 0,
"description": "Current class companion object receiver has higher priority than any of the superclass companion objects;",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.2.kt",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-6/pos/4.2.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}

View File

@@ -17,6 +17,54 @@
"path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
}
],
"2": [
@@ -35,6 +83,54 @@
"path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
}
],
"3": [
@@ -45,6 +141,54 @@
"path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/neg/1.2.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
}
],
"10": [
@@ -249,6 +393,86 @@
"path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
}
],
"2": [
@@ -267,6 +491,86 @@
"path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
}
],
"3": [
@@ -277,6 +581,86 @@
"path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/pos/1.2.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and inline operator function",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
},
{
"specVersion": "0.1-488",
"casesNumber": 0,
"description": "nullable receiver and infix functions",
"path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "secondary"
}
],
"10": [

View File

@@ -0,0 +1,122 @@
{
"3": {
"pos": {
"1": [
{
"specVersion": "0.1-387",
"casesNumber": 11,
"description": "call with explicit receiver: different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 1,
"description": "infix call: different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.5.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 3,
"description": "call with implicit receiver (built-in integer types extesnsion): different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.4.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 2,
"description": "different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.7.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 4,
"description": "call with implicit receiver: different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 3,
"description": "call with explicit receiver (built-in integer types extesnsion): different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 1,
"description": "infix call (built-in integer types extesnsion): different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.6.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 1,
"description": "call with explicit receiver",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.5.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 4,
"description": "call with explicit receiver: different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 2,
"description": "The candidate having any variable-argument parameters is less specific",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/5.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 3,
"description": "call with implicit receiver (built-in integer types extesnsion): different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.4.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 4,
"description": "call with implicit receiver: different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.3.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-387",
"casesNumber": 3,
"description": "call with explicit receiver (built-in integer types extesnsion): different built-in integer types and one of them is kotlin.Int",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"2": [
{
"specVersion": "0.1-387",
"casesNumber": 4,
"description": "prefer kotlin.Short to kotlin.Byte.",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos/1.3.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
]
}
}
}

View File

@@ -11,9 +11,10 @@
* DESCRIPTION: Abstract classes may contain one or more abstract members, which should be implemented in a subtype of this abstract class
*/
// TESTCASE NUMBER: 1
<!REDUNDANT_MODIFIER!>open<!> abstract class Base {
// FILE: TestCase1.kt
// TESTCASE NUMBER:1
package testPackCase1
<!REDUNDANT_MODIFIER!>open<!> abstract class Base {
abstract val a: Any
abstract var b: Any
@@ -24,22 +25,34 @@
abstract fun foo()
internal abstract fun boo(): Any
}
fun case1() {
val impl = BaseImplCase2(1, "1", 1.0)
val impl = BaseImplCase1(1, "1", 1.0)
}
class BaseImplCase2(
class BaseImplCase1(
override var a: Any, override
<!VAR_OVERRIDDEN_BY_VAL!>val<!> b: Any, override var c: Any, override
<!VAR_OVERRIDDEN_BY_VAL!>val<!> d: Any = "5") : Base()
<!VAR_OVERRIDDEN_BY_VAL!>val<!> d: Any = "5") : Base()
{
override fun foo() {}
override internal fun boo() {}
}
// FILE: TestCase2.kt
// TESTCASE NUMBER: 2
package testPackCase2
<!REDUNDANT_MODIFIER!>open<!> abstract class Base {
abstract val a: Any
abstract var b: Any
internal abstract val c: Any
internal abstract var d: Any
abstract fun foo()
internal abstract fun boo(): Any
}
fun case2() {
val impl = ImplBaseCase2()
@@ -68,10 +81,22 @@ class ImplBaseCase2() : Base() {
}
}
/*
* TESTCASE NUMBER: 3
* NOTE: property is not implemented
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 3
package testPackCase3
<!REDUNDANT_MODIFIER!>open<!> abstract class Base {
abstract val a: Any
abstract var b: Any
internal abstract val c: Any
internal abstract var d: Any
abstract fun foo()
internal abstract fun boo(): Any
}
fun case3() {
ImplBaseCase3()
}
@@ -95,10 +120,21 @@ fun case3() {
}
}
/*
* TESTCASE NUMBER: 4
* NOTE: function is not implemented
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 4
package testPackCase4
<!REDUNDANT_MODIFIER!>open<!> abstract class Base {
abstract val a: Any
abstract var b: Any
internal abstract val c: Any
internal abstract var d: Any
abstract fun foo()
internal abstract fun boo(): Any
}
fun case4() {
ImplBaseCase4()
@@ -125,4 +161,4 @@ fun case4() {
* TESTCASE NUMBER: 5
* NOTE: incompatible modifiers final and abstract
*/
<!INCOMPATIBLE_MODIFIERS!>final<!> <!INCOMPATIBLE_MODIFIERS!>abstract<!> class Case5() {}
<!INCOMPATIBLE_MODIFIERS!>final<!> <!INCOMPATIBLE_MODIFIERS!>abstract<!> class Case5() {}

View File

@@ -11,7 +11,9 @@
* DESCRIPTION: Abstract classes may contain abstract members, which should be implemented in an anonymous class that inherits from that abstract type
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 1
package testPackCase1
private abstract class Base {
abstract val a: Any
@@ -24,7 +26,6 @@ private abstract class Base {
internal abstract fun boo(): Any
}
fun case1() {
val impl = object : Base() {
override var a: Any
@@ -47,11 +48,26 @@ fun case1() {
}
// FILE: TestCase.kt
/*
* TESTCASE NUMBER: 2
* NOTE: property is not implemented
*/
* TESTCASE NUMBER: 2
* NOTE: property is not implemented
*/
package testPackCase2
private abstract class Base {
abstract val a: Any
abstract var b: Any
internal abstract val c: Any
internal abstract var d: Any
abstract fun foo()
internal abstract fun boo(): Any
}
fun case2() {
val impl = <!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>object<!> : Base() {
override var b: Any
@@ -74,10 +90,20 @@ fun case2() {
}
/*
* TESTCASE NUMBER: 3
* NOTE: function is not implemented
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 3
package testPackCase3
private abstract class Base {
abstract val a: Any
abstract var b: Any
internal abstract val c: Any
internal abstract var d: Any
abstract fun foo()
internal abstract fun boo(): Any
}
fun case3() {
val impl = <!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>object<!> : Base() {

View File

@@ -11,7 +11,9 @@
* DESCRIPTION: attempt to implement abstract members with invalid types
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 1
package testPackCase1
abstract class Base {
abstract val a: CharSequence
abstract var b: CharSequence
@@ -34,9 +36,16 @@ class Case1 : Base() {
}
/*
* TESTCASE NUMBER: 2
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 2
package testPackCase2
abstract class Base {
abstract val a: CharSequence
abstract var b: CharSequence
abstract fun foo(): CharSequence
}
class Case2(override val a: String, override var b: <!VAR_TYPE_MISMATCH_ON_OVERRIDE!>String<!>) : Base() {
override fun foo(): <!RETURN_TYPE_MISMATCH_ON_OVERRIDE!>CharSequence?<!> {
@@ -44,10 +53,16 @@ class Case2(override val a: String, override var b: <!VAR_TYPE_MISMATCH_ON_OVERR
}
}
/*
* TESTCASE NUMBER: 3
* NOTE: abstract nested class members are not implemented
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 3
package testPackCase3
abstract class Base {
abstract val a: CharSequence
abstract var b: CharSequence
abstract fun foo(): CharSequence
}
class Case3 {
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class ImplBase1<!> : MainClass.Base1() {}

View File

@@ -64,7 +64,7 @@
},
{
"specVersion": "0.1-213",
"casesNumber": 1,
"casesNumber": 3,
"description": "Abstract classes may contain abstract members, which should be implemented in an anonymous class that inherits from that abstract type",
"path": "compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.2.kt",
"unexpectedBehaviour": false,
@@ -72,7 +72,7 @@
},
{
"specVersion": "0.1-213",
"casesNumber": 1,
"casesNumber": 3,
"description": "attempt to implement abstract members with invalid types",
"path": "compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.3.kt",
"unexpectedBehaviour": false,
@@ -128,7 +128,7 @@
},
{
"specVersion": "0.1-213",
"casesNumber": 2,
"casesNumber": 4,
"description": "Abstract classes may contain one or more abstract members, which should be implemented in a subtype of this abstract class",
"path": "compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.1.kt",
"unexpectedBehaviour": false,

View File

@@ -11,12 +11,11 @@
* DESCRIPTION: check the type of jump expressions is Nothing and code placed on the left side of expression will never be executed
*/
// TESTCASE NUMBER: 1
fun case1() {
var name: Any? = null
val men = arrayListOf(Person("Phill"), Person(), Person("Bob"))
val men = arrayListOf(Person1("Phill"), Person1(), Person1("Bob"))
for (k in men) {
k.name
loop@ for (i in men) {
@@ -31,13 +30,13 @@ fun case1() {
val a = 1
}
class Person(var name: String? = null) {}
class Person1(var name: String? = null) {}
// TESTCASE NUMBER: 2
fun case2() {
var name: Any? = null
val men = arrayListOf(Person("Phill"), Person(), Person("Bob"))
val men = arrayListOf(Person2("Phill"), Person2(), Person2("Bob"))
for (k in men) {
loop@ for (i in men) {
i.name
@@ -51,6 +50,8 @@ fun case2() {
val a = 1
}
class Person2(var name: String? = null) {}
// TESTCASE NUMBER: 3
fun case3() {

View File

@@ -42,11 +42,11 @@ fun case2() {
}
// TESTCASE NUMBER: 3
interface Processable<T> {
interface ProcessableCase3<T> {
fun process(): T
}
class Processor : Processable<Unit> {
class Processor : ProcessableCase3<Unit> {
override fun process() {
val proc = "case 3"
}
@@ -58,6 +58,10 @@ fun case3() {
}
// TESTCASE NUMBER: 4
interface Processable<T> {
fun process(): T
}
fun case4() {
val p2 = object : Processable<Unit> {
override fun process() {

View File

@@ -14,28 +14,38 @@
* HELPERS: checkType
*/
class A(val a: Int) {
var isCompared = false
operator fun compareTo(other: A): Int = run {
isCompared = true
this.a - other.a
}
}
// TESTCASE NUMBER: 1
fun case1() {
val a1 = A(-1)
val a2 = A(-3)
val a1 = A1(-1)
val a2 = A1(-3)
val x = a1 < a2
x checkType { check<Boolean>() }
}
class A1(val a: Int) {
var isCompared = false
operator fun compareTo(other: A1): Int = run {
isCompared = true
this.a - other.a
}
}
// TESTCASE NUMBER: 2
class A2(val a: Int) {
var isCompared = false
operator fun compareTo(other: A2): Int = run {
isCompared = true
this.a - other.a
}
}
fun case2() {
val a1 = A(-1)
val a2 = A(-3)
val a1 = A2(-1)
val a2 = A2(-3)
val x = a1 > a2
@@ -44,20 +54,36 @@ fun case2() {
// TESTCASE NUMBER: 3
fun case3() {
val a1 = A(-1)
val a2 = A(-3)
val a1 = A3(-1)
val a2 = A3(-3)
val x = a1 <= a2
x checkType { check<Boolean>() }
}
class A3(val a: Int) {
var isCompared = false
operator fun compareTo(other: A3): Int = run {
isCompared = true
this.a - other.a
}
}
// TESTCASE NUMBER: 4
fun case4() {
val a1 = A(-1)
val a2 = A(-3)
val a1 = A4(-1)
val a2 = A4(-3)
val x = a1 >= a2
x checkType { check<Boolean>() }
}
class A4(val a: Int) {
var isCompared = false
operator fun compareTo(other: A4): Int = run {
isCompared = true
this.a - other.a
}
}

View File

@@ -13,6 +13,8 @@
* HELPERS: checkType
*/
// FILE: TestCases.kt
// TESTCASE NUMBER: 1
fun case1() {
@@ -59,7 +61,12 @@ interface `true`{}
interface `false`{}
// FILE: TestCase7.kt
// TESTCASE NUMBER: 7
package testPackCase7c
interface `true`{}
interface `false`{}
fun case7() {
class `true` : `false`{}

View File

@@ -5,7 +5,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-218
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, character-literals -> paragraph 1 -> sentence 1
* PRIMARY LINKS: expressions, constant-literals, character-literals -> paragraph 1 -> sentence 2
* expressions, constant-literals, character-literals -> paragraph 2 -> sentence 1

View File

@@ -6,7 +6,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-218
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, character-literals -> paragraph 1 -> sentence 1
* PRIMARY LINKS: expressions, constant-literals, character-literals -> paragraph 1 -> sentence 2
* expressions, constant-literals, character-literals -> paragraph 2 -> sentence 1

View File

@@ -3,7 +3,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 4,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg/1.1.kt",
@@ -14,7 +14,7 @@
],
"2": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 4,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg/1.1.kt",
@@ -27,7 +27,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 1,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos/1.1.kt",
@@ -38,7 +38,7 @@
],
"2": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 1,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos/1.1.kt",
@@ -53,7 +53,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 4,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg/1.1.kt",
@@ -64,7 +64,7 @@
],
"2": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 4,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg/1.1.kt",
@@ -77,7 +77,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 1,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos/1.1.kt",
@@ -88,7 +88,7 @@
],
"2": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 1,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos/1.1.kt",
@@ -103,7 +103,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 4,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg/1.1.kt",
@@ -125,7 +125,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 1,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos/1.1.kt",
@@ -158,7 +158,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-218",
"specVersion": "0.1-435",
"casesNumber": 1,
"description": "A character literal defines a constant holding a unicode character value",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos/1.1.kt",

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 1
* DESCRIPTION: Real literals without digits after an exponent mark.

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 2
* DESCRIPTION: Real literals with a not allowed exponent mark at the beginning.

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 3
* DESCRIPTION: Real literals suffixed by f/F (float suffix) with a not allowed exponent mark at the beginning.

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 4
* DESCRIPTION: Real literals suffixed by f/F (float suffix) with an exponent mark without digits after it.

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 1
* DESCRIPTION: Simple real literals with an exponent mark.

View File

@@ -1,7 +1,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, constant-literals, real-literals -> paragraph 2 -> sentence 1
* NUMBER: 2
* DESCRIPTION: Real literals suffixed by f/F (float suffix) with an exponent mark.

View File

@@ -259,7 +259,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 13,
"description": "Real literals with a not allowed exponent mark at the beginning.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.2.kt",
@@ -267,7 +267,7 @@
"linkType": "main"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 13,
"description": "Real literals suffixed by f/F (float suffix) with a not allowed exponent mark at the beginning.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.3.kt",
@@ -275,7 +275,7 @@
"linkType": "main"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 17,
"description": "Real literals suffixed by f/F (float suffix) with an exponent mark without digits after it.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.4.kt",
@@ -283,7 +283,7 @@
"linkType": "main"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 17,
"description": "Real literals without digits after an exponent mark.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.1.kt",
@@ -295,7 +295,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 26,
"description": "Real literals suffixed by f/F (float suffix) with an exponent mark.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/pos/1.2.kt",
@@ -303,7 +303,7 @@
"linkType": "main"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 39,
"description": "Simple real literals with an exponent mark.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/pos/1.1.kt",

View File

@@ -13,7 +13,6 @@
* DESCRIPTION: Value equality expressions always have type kotlin.Boolean as does the equals method in kotlin.Any
* HELPERS: checkType
*/
data class A(val a: Boolean)
// TESTCASE NUMBER: 1
@@ -22,12 +21,16 @@ fun case1() {
x checkType { check<Boolean>() }
}
data class A(val a: Boolean)
// TESTCASE NUMBER: 2
fun case2() {
val x = A(false) == A(false)
val x = A1(false) == A1(false)
x checkType { check<Boolean>() }
}
data class A1(val a: Boolean)
// TESTCASE NUMBER: 3
fun case3() {
val x = true == false

View File

@@ -12,6 +12,8 @@
* DESCRIPTION: check he type of jump expressions is the kotlin.Nothing
*/
// TESTCASE NUMBER: 1
fun case1() {
@@ -27,14 +29,13 @@ fun case1() {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>s<!>
}
}
class Person(var name: String? = null) {}
// TESTCASE NUMBER: 2
fun case2() {
var name: Any? = null
val men = arrayListOf(Person("Phill"), Person(), Person("Bob"))
val men = arrayListOf(Person2("Phill"), Person2(), Person2("Bob"))
for (k in men) {
loop@ for (i in men) {
val val1 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>continue@loop<!>
@@ -45,6 +46,8 @@ fun case2() {
}
}
class Person2(var name: String? = null) {}
// TESTCASE NUMBER: 3
fun case3() {

View File

@@ -11,14 +11,7 @@
* NUMBER: 1
* DESCRIPTION: check unsafe prefix decrement expression call for an assignable expression
*/
class A() {
var i = 0
operator fun dec(): A {
this.i--
return this
}
}
// TESTCASE NUMBER: 1
@@ -32,6 +25,15 @@ class Case1() {
var a: A = A()
}
class A() {
var i = 0
operator fun dec(): A {
this.i--
return this
}
}
// TESTCASE NUMBER: 2
fun case2() {
@@ -40,5 +42,14 @@ fun case2() {
}
class Case2() {
val a = A()
val a = A2()
}
class A2() {
var i = 0
operator fun dec(): A2 {
this.i--
return this
}
}

View File

@@ -11,6 +11,12 @@
* NUMBER: 1
* DESCRIPTION: check unsafe prefix increment expression call for an assignable expression
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 1
package testPackCase1
class A() {
var i = 0
@@ -20,8 +26,6 @@ class A() {
}
}
// TESTCASE NUMBER: 1
fun case1() {
var b: Case1? = Case1()
<!UNSAFE_CALL!>++<!>b?.a
@@ -32,7 +36,18 @@ class Case1() {
var a: A = A()
}
// FILE: TestCase.kt
// TESTCASE NUMBER: 2
package testPackCase2
class A() {
var i = 0
operator fun inc(): A {
this.i++
return this
}
}
fun case2() {
var b= Case2()

View File

@@ -11,15 +11,22 @@
* NUMBER: 1
* DESCRIPTION: The type of the try-expression is the least upper bound of the types of the last expressions of the try body and the last expressions of all the catch blocks
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 1
package testPackCase1
fun throwExceptionA(b: Boolean) = run { if (b) throw ExcA() }
class ExcA() : Exception()
class ExcB() : Exception()
open class A<T>(var data: T) {
fun foo(d: A<T>) {}
}
class B<T>(data: T) : A<T>(data)
// TESTCASE NUMBER: 1
fun case1() {
val tryVal: B<String> =
@@ -29,11 +36,25 @@ fun case1() {
} catch (e: Exception) {
B("")
}<!>
}
// FILE: TestCase.kt
// TESTCASE NUMBER: 2
package testPackCase2
fun throwExceptionA(b: Boolean) = run { if (b) throw ExcA() }
class ExcA() : Exception()
class ExcB() : Exception()
open class A<T>(var data: T) {
fun foo(d: A<T>) {}
}
class B<T>(data: T) : A<T>(data)
fun case2() {
val tryVal: A<String> =
@@ -45,10 +66,20 @@ fun case2() {
}<!>
}
/*
* TESTCASE NUMBER: 3
* ISSUES: KT-35494
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 3
// ISSUES: KT-35494
package testPackCase3
fun throwExceptionA(b: Boolean) = run { if (b) throw ExcA() }
open class A<T>(var data: T) {
fun foo(d: A<T>) {}
}
class B<T>(data: T) : A<T>(data)
fun case3() {
val tryVal: A<Int> =
<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>try {

View File

@@ -185,7 +185,7 @@
"casesNumber": 3,
"description": "The type of the try-expression is the least upper bound of the types of the last expressions of the try body and the last expressions of all the catch blocks",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt",
"unexpectedBehaviour": true,
"unexpectedBehaviour": false,
"linkType": "main"
}
]
@@ -212,7 +212,7 @@
"casesNumber": 3,
"description": "The type of the try-expression is the least upper bound of the types of the last expressions of the try body and the last expressions of all the catch blocks",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt",
"unexpectedBehaviour": true,
"unexpectedBehaviour": false,
"linkType": "primary"
}
]

View File

@@ -13,6 +13,13 @@
* HELPERS: checkType
*/
// FILE: TestCase.kt
// TESTCASE NUMBER: 1
package testPackCase1
import checkType
import check
class A(val a: Set<Any>) {
operator fun contains(other: Any?): Boolean = run { this.a.contains(other) }
@@ -27,7 +34,6 @@ class C() {
}
}
// TESTCASE NUMBER: 1
fun case1() {
val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza"))
val c = C()
@@ -35,14 +41,52 @@ fun case1() {
a checkType { check<Boolean>() }
}
// FILE: TestCase.kt
// TESTCASE NUMBER: 2
package testPackCase2
import checkType
import check
class A(val a: Set<Any>) {
operator fun contains(other: Any?): Boolean = run { this.a.contains(other) }
fun throwException(b: Boolean): A { if (b) throw Exception() else return this }
}
class C() {
var isEvaluated: Boolean = false
fun foo(): C {
this.isEvaluated = true
return this
}
}
fun case2() {
val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza"))
val a = (null in b)
a checkType { check<Boolean>() }
}
// FILE: TestCase.kt
// TESTCASE NUMBER: 3
package testPackCase3
import checkType
import check
class A(val a: Set<Any>) {
operator fun contains(other: Any?): Boolean = run { this.a.contains(other) }
fun throwException(b: Boolean): A { if (b) throw Exception() else return this }
}
class C() {
var isEvaluated: Boolean = false
fun foo(): C {
this.isEvaluated = true
return this
}
}
fun case3() {
val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza"))
val x = ""
@@ -50,7 +94,26 @@ fun case3() {
a checkType { check<Boolean>() }
}
// FILE: TestCase.kt
// TESTCASE NUMBER: 4
package testPackCase4
import checkType
import check
class A(val a: Set<Any>) {
operator fun contains(other: Any?): Boolean = run { this.a.contains(other) }
fun throwException(b: Boolean): A { if (b) throw Exception() else return this }
}
class C() {
var isEvaluated: Boolean = false
fun foo(): C {
this.isEvaluated = true
return this
}
}
fun case4(nothing: Nothing) {
val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza"))
val a = (nothing in b)

View File

@@ -1,6 +1,8 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
fun case_1(value_1: Boolean?): String = when(value_1) {
true -> ""

View File

@@ -4,8 +4,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
* NUMBER: 1
* DESCRIPTION: Non-exhaustive when using nullable boolean values.
*/

View File

@@ -1,6 +1,7 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
fun case_1(value_1: SealedClass?): String = when(value_1) {
is SealedChild1 -> ""

View File

@@ -4,8 +4,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
* NUMBER: 2
* DESCRIPTION: Non-exhaustive when using subclasses of the nullable sealed class.
* HELPERS: sealedClasses

View File

@@ -1,6 +1,7 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
fun case_1(value_1: EnumClass?): String = when(value_1) {
EnumClass.EAST -> ""

View File

@@ -4,8 +4,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
* NUMBER: 3
* DESCRIPTION: Non-exhaustive when using nullable enum values.
* HELPERS: enumClasses

View File

@@ -1,6 +1,7 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
fun case_1(value_1: SealedClass): String = when(value_1) {
is SealedChild1 -> ""

View File

@@ -4,8 +4,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* NUMBER: 1
* DESCRIPTION: Non-exhaustive when using subclasses of the sealed class.
* HELPERS: sealedClasses

View File

@@ -4,22 +4,22 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* NUMBER: 1
* DESCRIPTION: Exhaustive when using nullable boolean values.
* DESCRIPTION: Exhaustive when using enum values.
* HELPERS: enumClasses
*/
// TESTCASE NUMBER: 1
fun case_1(value_1: Boolean?): String = when (value_1) {
true -> ""
false -> ""
null -> ""
fun case_1(dir: EnumClass): String = when (dir) {
EnumClass.EAST -> ""
EnumClass.NORTH -> ""
EnumClass.SOUTH -> ""
EnumClass.WEST -> ""
}
// TESTCASE NUMBER: 2
fun case_2(value_1: Boolean?): String = when (value_1) {
true && false && ((true || false)) || true && !!!false && !!!true -> ""
true && false && ((true || false)) || true && !!!false -> ""
null -> ""
fun case_2(value_1: EnumClassSingle): String = when (value_1) {
EnumClassSingle.EVERYTHING -> ""
}

View File

@@ -0,0 +1,25 @@
// FIR_IDENTICAL
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
* NUMBER: 1
* DESCRIPTION: Exhaustive when using nullable boolean values.
*/
// TESTCASE NUMBER: 1
fun case_1(value_1: Boolean?): String = when (value_1) {
true -> ""
false -> ""
null -> ""
}
// TESTCASE NUMBER: 2
fun case_2(value_1: Boolean?): String = when (value_1) {
true && false && ((true || false)) || true && !!!false && !!!true -> ""
true && false && ((true || false)) || true && !!!false -> ""
null -> ""
}

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
* NUMBER: 2
* DESCRIPTION: Exhaustive when using nullable enum values.
* HELPERS: enumClasses

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
* NUMBER: 3
* DESCRIPTION: Exhaustive when using subclasses of the nullable sealed class.
* HELPERS: sealedClasses

View File

@@ -1,6 +1,7 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
fun case_1(value_1: SealedClass): Int = when (value_1) {
is SealedChild1 -> value_1.number

View File

@@ -4,8 +4,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 7
* NUMBER: 1
* DESCRIPTION: Exhaustive when using subclasses of the sealed class.
* HELPERS: sealedClasses

View File

@@ -1,25 +0,0 @@
// FIR_IDENTICAL
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 8
* NUMBER: 1
* DESCRIPTION: Exhaustive when using enum values.
* HELPERS: enumClasses
*/
// TESTCASE NUMBER: 1
fun case_1(dir: EnumClass): String = when (dir) {
EnumClass.EAST -> ""
EnumClass.NORTH -> ""
EnumClass.SOUTH -> ""
EnumClass.WEST -> ""
}
// TESTCASE NUMBER: 2
fun case_2(value_1: EnumClassSingle): String = when (value_1) {
EnumClassSingle.EVERYTHING -> ""
}

View File

@@ -1,64 +1,32 @@
{
"2": {
"neg": {
"10": [
"11": [
{
"specVersion": "0.1-100",
"casesNumber": 6,
"description": "Non-exhaustive when using nullable enum values.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/10.3.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "enumClasses"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 10,
"description": "Non-exhaustive when using subclasses of the nullable sealed class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/10.2.kt",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.2.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "sealedClasses"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 6,
"description": "Non-exhaustive when using nullable enum values.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.3.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "enumClasses"
},
{
"specVersion": "0.1-435",
"casesNumber": 3,
"description": "Non-exhaustive when using nullable boolean values.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/10.1.kt",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Else on nullable enum",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Else on nullable enum with smart cast",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"1": [
@@ -185,76 +153,16 @@
"linkType": "primary"
}
],
"6": [
"9": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 12,
"description": "Non-exhaustive when using subclasses of the sealed class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/6.1.kt",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/9.1.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "sealedClasses"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"4": [
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"9": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
@@ -360,6 +268,74 @@
"linkType": "primary"
}
],
"4": [
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"10": [
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Else on nullable enum",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Else on nullable enum with smart cast",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"5": [
{
"specVersion": "0.1-313",
@@ -386,6 +362,32 @@
"linkType": "primary"
}
],
"6": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"7": [
{
"specVersion": "0.1-152",
@@ -416,56 +418,32 @@
]
},
"pos": {
"10": [
"11": [
{
"specVersion": "0.1-100",
"casesNumber": 7,
"description": "Exhaustive when using subclasses of the nullable sealed class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.3.kt",
"unexpectedBehaviour": true,
"linkType": "main",
"helpers": "sealedClasses"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 3,
"description": "Exhaustive when using nullable enum values.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.2.kt",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.2.kt",
"unexpectedBehaviour": true,
"linkType": "main",
"helpers": "enumClasses"
},
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 7,
"description": "Exhaustive when using subclasses of the nullable sealed class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.3.kt",
"unexpectedBehaviour": true,
"linkType": "main",
"helpers": "sealedClasses"
},
{
"specVersion": "0.1-435",
"casesNumber": 2,
"description": "Exhaustive when using nullable boolean values.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.1.kt",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive platform enum null",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"1": [
@@ -577,28 +555,52 @@
"linkType": "primary"
}
],
"8": [
"7": [
{
"specVersion": "0.1-100",
"casesNumber": 2,
"description": "Exhaustive when using enum values.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/8.1.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "enumClasses"
}
],
"6": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-435",
"casesNumber": 9,
"description": "Exhaustive when using subclasses of the sealed class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/6.1.kt",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/7.1.kt",
"unexpectedBehaviour": true,
"linkType": "main",
"helpers": "sealedClasses"
}
],
"10": [
{
"specVersion": "0.1-435",
"casesNumber": 2,
"description": "Exhaustive when using enum values.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.1.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "enumClasses"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
"description": "Exhaustive platform enum null",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"9": [
{
"specVersion": "0.1-313",

View File

@@ -1,27 +0,0 @@
// FIR_IGNORE
// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
// SKIP_TXT
// TESTCASE NUMBER: 1
fun case_1(value_1: Int, value_2: List<Int>): String {
when (value_1) {
<!EXPRESSION_EXPECTED!>while (false) {}<!> -> return ""
<!EXPRESSION_EXPECTED!>do {} while (false)<!> -> return ""
<!EXPRESSION_EXPECTED!>for (value in value_2) {}<!> -> return ""
}
return ""
}
// TESTCASE NUMBER: 4
fun case_4(value_1: Int): String {
var value_2: Int
var value_3 = 10
when (value_1) {
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_2 = 10<!> -> return ""
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_3 %= 10<!> -> return ""
}
return ""
}

View File

@@ -1,35 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-201
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 11
* NUMBER: 1
* DESCRIPTION: 'When' with bound value and non-expressions in 'when condition'.
*/
// TESTCASE NUMBER: 1
fun case_1(value_1: Int, value_2: List<Int>): String {
when (value_1) {
<!EXPRESSION_EXPECTED!>while (false) {}<!> -> return ""
<!EXPRESSION_EXPECTED!>do {} while (false)<!> -> return ""
<!EXPRESSION_EXPECTED!>for (value in value_2) {}<!> -> return ""
}
return ""
}
// TESTCASE NUMBER: 4
fun case_4(value_1: Int): String {
var value_2: Int
var value_3 = 10
when (value_1) {
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_2 = 10<!> -> return ""
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_3 %= 10<!> -> return ""
}
return ""
}

View File

@@ -3,9 +3,9 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-201
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 12
* NUMBER: 1
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 7
* NUMBER: 2
* DESCRIPTION: 'When' without bound value and with 'else' branch not in the last position.
*/

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-201
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 10
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 5
* NUMBER: 1
* DESCRIPTION: 'When' with enumeration of the different variants of expressions in 'when condition'.
* HELPERS: typesProvider, classes, functions

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-201
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 10
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 5
* NUMBER: 2
* DESCRIPTION: 'When' with different variants of the arithmetic expressions (additive expression and multiplicative expression) in 'when condition'.
* HELPERS: typesProvider, classes, functions

View File

@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-201
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 11
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 6
* NUMBER: 1
* DESCRIPTION: 'When' with bound value and not allowed break and continue expression (without labels) in 'when condition'.
*/

View File

@@ -1,5 +0,0 @@
package
public fun case_1(/*0*/ value_1: kotlin.Int?): kotlin.String
public fun case_2(/*0*/ value_1: kotlin.Any): kotlin.String
public fun case_3(/*0*/ value_1: kotlin.Int): kotlin.String

View File

@@ -4,9 +4,9 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-201
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 12
* NUMBER: 1
* SPEC VERSION: 0.1-435
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 7
* NUMBER: 2
* DESCRIPTION: 'When' without bound value and with else branch in the last position.
*/

View File

@@ -1,16 +1,6 @@
{
"6": {
"neg": {
"12": [
{
"specVersion": "0.1-201",
"casesNumber": 3,
"description": "\u0027When\u0027 without bound value and with \u0027else\u0027 branch not in the last position.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/12.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
],
"1": [
{
"specVersion": "0.1-296",
@@ -116,6 +106,14 @@
}
],
"7": [
{
"specVersion": "0.1-435",
"casesNumber": 3,
"description": "\u0027When\u0027 without bound value and with \u0027else\u0027 branch not in the last position.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.2.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-313",
"casesNumber": 3,
@@ -125,32 +123,6 @@
"linkType": "main"
}
],
"11": [
{
"specVersion": "0.1-201",
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and non-expressions in \u0027when condition\u0027.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"5": [
{
"specVersion": "0.1-152",
@@ -212,19 +184,27 @@
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"11": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false,
"linkType": "primary"
}
]
},
"pos": {
"12": [
{
"specVersion": "0.1-201",
"casesNumber": 2,
"description": "\u0027When\u0027 without bound value and with else branch in the last position.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/12.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
],
"1": [
{
"specVersion": "0.1-296",
@@ -287,26 +267,6 @@
"linkType": "primary"
}
],
"10": [
{
"specVersion": "0.1-201",
"casesNumber": 26,
"description": "\u0027When\u0027 with different variants of the arithmetic expressions (additive expression and multiplicative expression) in \u0027when condition\u0027.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.2.kt",
"unexpectedBehaviour": true,
"linkType": "main",
"helpers": "typesProvider, classes, functions"
},
{
"specVersion": "0.1-201",
"casesNumber": 23,
"description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.1.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "typesProvider, classes, functions"
}
],
"3": [
{
"specVersion": "0.1-296",
@@ -328,6 +288,14 @@
}
],
"7": [
{
"specVersion": "0.1-435",
"casesNumber": 2,
"description": "\u0027When\u0027 without bound value and with else branch in the last position.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.2.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-313",
"casesNumber": 3,
@@ -337,17 +305,25 @@
"linkType": "main"
}
],
"11": [
{
"specVersion": "0.1-201",
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in \u0027when condition\u0027.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/11.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
],
"5": [
{
"specVersion": "0.1-435",
"casesNumber": 23,
"description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.1.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "typesProvider, classes, functions"
},
{
"specVersion": "0.1-435",
"casesNumber": 26,
"description": "\u0027When\u0027 with different variants of the arithmetic expressions (additive expression and multiplicative expression) in \u0027when condition\u0027.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.2.kt",
"unexpectedBehaviour": true,
"linkType": "main",
"helpers": "typesProvider, classes, functions"
},
{
"specVersion": "0.1-313",
"casesNumber": 0,
@@ -372,6 +348,16 @@
"unexpectedBehaviour": false,
"linkType": "primary"
}
],
"6": [
{
"specVersion": "0.1-435",
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in \u0027when condition\u0027.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt",
"unexpectedBehaviour": false,
"linkType": "main"
}
]
}
},

View File

@@ -0,0 +1,70 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
/*
* TESTCASE NUMBER: 1
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-39129
*/
fun case1() {
C1.<!INAPPLICABLE_CANDIDATE!>V<!>()
C1.Companion.<!DEBUG_INFO_CALL("fqName: C1.Companion.V.V; typeCall: function")!>V()<!>
}
class C1(){
companion object {
class V(){
}
}
}
/*
* TESTCASE NUMBER: 2
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-39129
*/
fun case2() {
C2.<!DEBUG_INFO_CALL("fqName: L.invoke; typeCall: variable&invoke")!>V()<!> // to (2)
C2.Companion.<!DEBUG_INFO_CALL("fqName: C2.Companion.V.V; typeCall: function")!>V()<!> // to (1)
}
open class C2(){
companion object {
class V //(1)
}
object V : L()
}
open class L {
operator fun invoke() {} //(2)
}
/*
* TESTCASE NUMBER: 3
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-39129
*/
fun case3() {
C3.<!DEBUG_INFO_CALL("fqName: L3.invoke; typeCall: variable&invoke")!>V()<!> // to (2)
C3.Companion.<!DEBUG_INFO_CALL("fqName: C3.Companion.V.V; typeCall: function")!>V()<!> // to (1)
}
open class C3(){
companion object {
class V //(1)
}
object V : L3()
}
open class L3 {
operator fun invoke(s : String ="") {} //(2)
}

View File

@@ -0,0 +1,78 @@
// !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-401
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver, call-with-an-explicit-type-receiver -> paragraph 3 -> sentence 2
* NUMBER: 1
* DESCRIPTION:
*/
/*
* TESTCASE NUMBER: 1
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-39129
*/
fun case1() {
C1.<!UNRESOLVED_REFERENCE!>V<!>()
C1.Companion.<!DEBUG_INFO_CALL("fqName: C1.Companion.V.<init>; typeCall: function")!>V()<!>
}
class C1(){
companion object {
class V(){
}
}
}
/*
* TESTCASE NUMBER: 2
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-39129
*/
fun case2() {
C2.<!DEBUG_INFO_CALL("fqName: C2.V.invoke; typeCall: variable&invoke")!>V()<!> // to (2)
C2.Companion.<!DEBUG_INFO_CALL("fqName: C2.Companion.V.<init>; typeCall: function")!>V()<!> // to (1)
}
open class C2(){
companion object {
class V //(1)
}
object V : L()
}
open class L {
operator fun invoke() {} //(2)
}
/*
* TESTCASE NUMBER: 3
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-39129
*/
fun case3() {
C3.<!DEBUG_INFO_CALL("fqName: C3.V.invoke; typeCall: variable&invoke")!>V()<!> // to (2)
C3.Companion.<!DEBUG_INFO_CALL("fqName: C3.Companion.V.<init>; typeCall: function")!>V()<!> // to (1)
}
open class C3(){
companion object {
class V //(1)
}
object V : L3()
}
open class L3 {
operator fun invoke(s : String ="") {} //(2)
}

View File

@@ -0,0 +1,16 @@
{
"3": {
"pos": {
"2": [
{
"specVersion": "0.1-401",
"casesNumber": 3,
"description": "",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3/pos/2.1.kt",
"unexpectedBehaviour": true,
"linkType": "main"
}
]
}
}
}

View File

@@ -0,0 +1,55 @@
// FIR_IDENTICAL
// !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-268
* MAIN LINK:overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 3
* PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 4
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 5
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 11 -> sentence 1
* overload-resolution, building-the-overload-candidate-set-ocs, call-with-trailing-lambda-expressions -> paragraph 1 -> sentence 2
* NUMBER: 2
* DESCRIPTION: sets of explicitly imported callables
*/
// FILE: TestCase1.kt
// TESTCASE NUMBER: 1
package testsCase1
import libCase1.*
import kotlin.text.format
fun Case1() {
val x2 = "".<!DEBUG_INFO_CALL("fqName: kotlin.text.format; typeCall: inline extension function")!>format("")<!>
val y2 = String.<!DEBUG_INFO_CALL("fqName: kotlin.text.format; typeCall: inline extension function")!>format("")<!>
}
fun String.invoke(format: String, vararg args: Any?): String = "" //(2)
val String.format: String
get() = "1"
val String.Companion.format: String
get() = "1"
// FILE: LibCase1.kt
package libCase1
val String.Companion.format: String
get() = "1"
fun String.invoke(format: String, vararg args: Any?): String = ""
val String.format: String
get() = "1"

Some files were not shown because too many files have changed in this diff Show More