[Spec tests] Add tests for intersection and OR

This commit is contained in:
anastasiia.spaseeva
2020-07-28 11:14:46 +03:00
parent 46774fb6d6
commit 0488dc985f
18 changed files with 962 additions and 13 deletions
@@ -15,9 +15,9 @@ import LibPackCase1.b.*
fun case1 (){
var b: B? = B()
<!DEBUG_INFO_CALL("fqName: LibPackCase1.b.plusAssign; typeCall: operator extension function")!>b += { C() }<!>
<!AMBIGUITY, DEBUG_INFO_CALL("fqName: fqName is unknown; typeCall: unresolved")!>b += { C() }<!>
<!DEBUG_INFO_CALL("fqName: LibPackCase1.a.plusAssign; typeCall: operator extension function")!>b += {1}<!>
<!AMBIGUITY, DEBUG_INFO_CALL("fqName: fqName is unknown; typeCall: unresolved")!>b += {1}<!>
}
class B {
@@ -10,9 +10,9 @@ import LibPackCase1.a.*
import LibPackCase1.b.*
fun case1 (){
var b: B? = null
<!DEBUG_INFO_CALL("fqName: LibPackCase1.b.plusAssign; typeCall: inline operator extension function")!>b += { C() }<!>
<!AMBIGUITY, DEBUG_INFO_CALL("fqName: fqName is unknown; typeCall: unresolved")!>b += { C() }<!>
<!DEBUG_INFO_CALL("fqName: LibPackCase1.a.plusAssign; typeCall: inline operator extension function")!>b += {1}<!>
<!AMBIGUITY, DEBUG_INFO_CALL("fqName: fqName is unknown; typeCall: unresolved")!>b += {1}<!>
}
class B {
@@ -15,9 +15,9 @@ import LibPackCase1.b.*
fun case1 (){
var b: B? = B()
b += { C() }
<!AMBIGUITY!>b += { C() }<!>
b += {1}
<!AMBIGUITY!>b += {1}<!>
}
class B {
@@ -15,9 +15,9 @@ import LibPackCase1.b.plusAssign
fun case1 (){
var b: B? = B()
b += { C() }
<!AMBIGUITY!>b += { C() }<!>
b += {1}
<!AMBIGUITY!>b += {1}<!>
}
class B {
@@ -15,8 +15,8 @@ import LibPackCase1.b.plusAssign
fun case1 (){
var b: B = B()
b +={ C() }
b +={ 1 }
<!AMBIGUITY!>b +={ C() }<!>
<!AMBIGUITY!>b +={ 1 }<!>
}
class B
@@ -48,8 +48,8 @@ import LibPackCase2.b.plusAssign
fun case2 (){
var b: B = B()
b +={ C() }
b +={ 1 }
<!AMBIGUITY!>b +={ C() }<!>
<!AMBIGUITY!>b +={ 1 }<!>
b.<!AMBIGUITY!>plusAssign<!>{ C() }
}
@@ -14,7 +14,7 @@ import LibPackCase1.a.plusAssign
fun case1 (){
var b: B = B()
<!INAPPLICABLE_CANDIDATE!>b +={ C() }<!>
b +={ C() }
b +={ 1 }
}
@@ -0,0 +1,19 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
interface A1
interface B1
fun case1(x: Any) {
fun A1.foo(): kotlin.Int = 1 //(1)
fun B1.foo(): kotlin.Int = 2 //(2)
fun Any.foo(): kotlin.String = "Any" //(3)
x.<!DEBUG_INFO_CALL("fqName: case1.foo; typeCall: extension function")!>foo()<!> // to (3)
x.foo()
if (x is B1 && x is A1) {
x.<!AMBIGUITY!>foo<!>()
}
}
@@ -0,0 +1,28 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-464
* MAIN LINK: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 9 -> sentence 2
* NUMBER: 3
* DESCRIPTION: receiver of intersection type ambuguity
*/
// TESTCASE NUMBER: 1
interface A1
interface B1
fun case1(x: Any) {
fun A1.foo(): kotlin.Int = 1 //(1)
fun B1.foo(): kotlin.Int = 2 //(2)
fun Any.foo(): kotlin.String = "Any" //(3)
x.<!DEBUG_INFO_CALL("fqName: case1.foo; typeCall: extension function")!>foo()<!> // to (3)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>x.foo()<!>
if (x is B1 && x is A1) {
x.<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>()
}
}
@@ -1008,6 +1008,14 @@
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-464",
"casesNumber": 1,
"description": "receiver of intersection type ambuguity",
"path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.kt",
"unexpectedBehaviour": false,
"linkType": "main"
},
{
"specVersion": "0.1-448",
"casesNumber": 2,
@@ -0,0 +1,64 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
/*
* TESTCASE NUMBER: 1
* ISSUES: KT-39405
*/
interface I{
}
enum class EA : I {
A
}
enum class EB : I {
B
}
fun case1(a: Any) {
val x1 = if (true) EA.A else EB.B
checkSubtype<Enum<*>>(x1)
checkSubtype<I>(x1)
<!DEBUG_INFO_EXPRESSION_TYPE("I & kotlin.Enum<*>")!>x1<!>
val x2 = if (true) EB.B else EA.A
checkSubtype<Enum<*>>(x2)
checkSubtype<I>(x2)
<!DEBUG_INFO_EXPRESSION_TYPE("I & kotlin.Enum<*>")!>x2<!>
val x3 = when(a){
is Int -> EA.A
else -> EB.B
}
checkSubtype<Enum<*>>(x3)
checkSubtype<I>(x3)
<!DEBUG_INFO_EXPRESSION_TYPE("I & kotlin.Enum<*>")!>x3<!>
}
/*
* TESTCASE NUMBER: 2
*/
enum class A {
A
}
interface IB
enum class B : IB {
B
}
fun case2(a: Any) {
val x1 = if (true) A.A else B.B
checkSubtype<Enum<*>>(x1)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Enum<*>")!>x1<!>
val x2 = if (true) B.B else A.A
checkSubtype<Enum<*>>(x2)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Enum<*>")!>x2<!>
val x3 = when(a){
is Int -> A.A
else -> B.B
}
checkSubtype<Enum<*>>(x3)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Enum<*>")!>x3<!>
}
@@ -0,0 +1,74 @@
// !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-464
* MAIN LINK: type-system, subtyping, subtyping-for-intersection-types -> paragraph 1 -> sentence 1
* PRIMARY LINKS: type-system, subtyping, subtyping-for-intersection-types -> paragraph 2 -> sentence 3
* NUMBER: 1
* DESCRIPTION: intersection type inferred for enum classes
* HELPERS: checkType, functions
*/
/*
* TESTCASE NUMBER: 1
* ISSUES: KT-39405
*/
interface I{
}
enum class EA : I {
A
}
enum class EB : I {
B
}
fun case1(a: Any) {
val x1 = if (true) EA.A else EB.B
checkSubtype<Enum<*>>(x1)
checkSubtype<I>(x1)
<!DEBUG_INFO_EXPRESSION_TYPE("{Enum<*> & I}")!>x1<!>
val x2 = if (true) EB.B else EA.A
checkSubtype<Enum<*>>(x2)
checkSubtype<I>(x2)
<!DEBUG_INFO_EXPRESSION_TYPE("{Enum<*> & I}")!>x2<!>
val x3 = when(a){
is Int -> EA.A
else -> EB.B
}
checkSubtype<Enum<*>>(x3)
checkSubtype<I>(x3)
<!DEBUG_INFO_EXPRESSION_TYPE("{Enum<*> & I}")!>x3<!>
}
/*
* TESTCASE NUMBER: 2
*/
enum class A {
A
}
interface IB
enum class B : IB {
B
}
fun case2(a: Any) {
val x1 = if (true) A.A else B.B
checkSubtype<Enum<*>>(x1)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Enum<*>")!>x1<!>
val x2 = if (true) B.B else A.A
checkSubtype<Enum<*>>(x2)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Enum<*>")!>x2<!>
val x3 = when(a){
is Int -> A.A
else -> B.B
}
checkSubtype<Enum<*>>(x3)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Enum<*>")!>x3<!>
}
@@ -0,0 +1,155 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
fun case1() {
val x = case1(object : A1, B1 {})
checkSubtype<A1>(x)
checkSubtype<B1>(x)
}
interface A1 {
fun fooA() = "A"
}
interface B1 {
fun fooB() = "B"
}
fun <T> case1(case: T): T where T : A1, T : B1 = case
// TESTCASE NUMBER: 2
fun case2() {
fun <T> case2(case: T): T where T : A2, T : B2 = case
val x = case2(C2())
checkSubtype<A2>(x)
checkSubtype<B2>(x)
}
class C2: A2, B2
interface A2 {
fun fooA() = "A"
}
interface B2 {
fun fooB() = "B"
}
// TESTCASE NUMBER: 3
fun case3() {
val x = case3(object : A3, B3 {})
checkSubtype<A3>(x)
checkSubtype<B3>(x)
}
interface A3 {
fun fooA() = "A"
}
interface B3 {
fun fooB() = "B"
}
fun <T> case3(case: T): T where T : A3, T : B3 = case
// TESTCASE NUMBER: 4
fun case4() {
fun <T> case4(case: T): T where T : A4, T : B4 = case
val x = case4(C4())
checkSubtype<A4>(x)
checkSubtype<B4>(x)
}
class C4: A4, B4
interface A4 {
fun fooA() = "A"
}
interface B4 {
fun fooB() = "B"
}
// TESTCASE NUMBER: 5
fun case5() {
val x = "" case5 object : A5, B5 {}
checkSubtype<A5>(x)
checkSubtype<B5>(x)
}
interface A5 {
fun fooA() = "A"
}
interface B5 {
fun fooB() = "B"
}
infix fun <T> CharSequence.case5(case: T): T where T : A5, T : B5 = case
// TESTCASE NUMBER: 6
fun case6() {
infix fun <T> CharSequence.case6(case: T): T where T : A6, T : B6 = case
val x = "" case6 C6()
checkSubtype<A6>(x)
checkSubtype<B6>(x)
}
class C6: A6, B6
interface A6 {
fun fooA() = "A"
}
interface B6 {
fun fooB() = "B"
}
// TESTCASE NUMBER: 7
fun case7() {
val x = case7(object : A7, B7 {})
checkSubtype<A7>(x)
checkSubtype<B7>(x)
}
interface A7 {
fun fooA() = "A"
}
interface B7 {
fun fooB() = "B"
}
fun <T> case7(case: T): T where T : A7, T : B7 = case
// TESTCASE NUMBER: 8
fun case8() {
infix fun <T> CharSequence.case8(case: T): T where T : A8, T : B8 = case
val x = "" case8 C8()
checkSubtype<A8>(x)
checkSubtype<B8>(x)
}
class C8: A8, B8
interface A8 {
fun fooA() = "A"
}
interface B8 {
fun fooB() = "B"
}
@@ -0,0 +1,165 @@
// !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-464
* MAIN LINK: type-system, subtyping, subtyping-for-intersection-types -> paragraph 1 -> sentence 1
* PRIMARY LINKS: type-system, subtyping, subtyping-for-intersection-types -> paragraph 2 -> sentence 3
* NUMBER: 2
* DESCRIPTION: intersection type inferred for parametrized functions
* HELPERS: checkType, functions
*/
// TESTCASE NUMBER: 1
fun case1() {
val x = case1(object : A1, B1 {})
checkSubtype<A1>(x)
checkSubtype<B1>(x)
}
interface A1 {
fun fooA() = "A"
}
interface B1 {
fun fooB() = "B"
}
fun <T> case1(case: T): T where T : A1, T : B1 = case
// TESTCASE NUMBER: 2
fun case2() {
fun <T> case2(case: T): T where T : A2, T : B2 = case
val x = case2(C2())
checkSubtype<A2>(x)
checkSubtype<B2>(x)
}
class C2: A2, B2
interface A2 {
fun fooA() = "A"
}
interface B2 {
fun fooB() = "B"
}
// TESTCASE NUMBER: 3
fun case3() {
val x = case3(object : A3, B3 {})
checkSubtype<A3>(x)
checkSubtype<B3>(x)
}
interface A3 {
fun fooA() = "A"
}
interface B3 {
fun fooB() = "B"
}
fun <T> case3(case: T): T where T : A3, T : B3 = case
// TESTCASE NUMBER: 4
fun case4() {
fun <T> case4(case: T): T where T : A4, T : B4 = case
val x = case4(C4())
checkSubtype<A4>(x)
checkSubtype<B4>(x)
}
class C4: A4, B4
interface A4 {
fun fooA() = "A"
}
interface B4 {
fun fooB() = "B"
}
// TESTCASE NUMBER: 5
fun case5() {
val x = "" case5 object : A5, B5 {}
checkSubtype<A5>(x)
checkSubtype<B5>(x)
}
interface A5 {
fun fooA() = "A"
}
interface B5 {
fun fooB() = "B"
}
infix fun <T> CharSequence.case5(case: T): T where T : A5, T : B5 = case
// TESTCASE NUMBER: 6
fun case6() {
infix fun <T> CharSequence.case6(case: T): T where T : A6, T : B6 = case
val x = "" case6 C6()
checkSubtype<A6>(x)
checkSubtype<B6>(x)
}
class C6: A6, B6
interface A6 {
fun fooA() = "A"
}
interface B6 {
fun fooB() = "B"
}
// TESTCASE NUMBER: 7
fun case7() {
val x = case7(object : A7, B7 {})
checkSubtype<A7>(x)
checkSubtype<B7>(x)
}
interface A7 {
fun fooA() = "A"
}
interface B7 {
fun fooB() = "B"
}
fun <T> case7(case: T): T where T : A7, T : B7 = case
// TESTCASE NUMBER: 8
fun case8() {
infix fun <T> CharSequence.case8(case: T): T where T : A8, T : B8 = case
val x = "" case8 C8()
checkSubtype<A8>(x)
checkSubtype<B8>(x)
}
class C8: A8, B8
interface A8 {
fun fooA() = "A"
}
interface B8 {
fun fooB() = "B"
}
@@ -0,0 +1,120 @@
// !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-40074
fun case1(x: Any) {
if (x is A1 && x is B1) {
checkSubtype<A1>(x)
checkSubtype<B1>(x)
<!DEBUG_INFO_EXPRESSION_TYPE("A1 & B1 & kotlin.Any")!>x<!> // A1 & B1 & kotlin.Any
}
}
interface A1
interface B1
// TESTCASE NUMBER: 2
fun <T> case2(x: T) {
if (x is B2 && x is A2) {
checkSubtype<A2>(x)
checkSubtype<B2>(x)
checkSubtype<T>(x)
x //NI A2 & B2 & T & T!! OI A2 & B2 & T
<!DEBUG_INFO_EXPRESSION_TYPE("B2 & A2 & T!! & T")!>x<!>
}
}
interface A2
interface B2
// TESTCASE NUMBER: 3
fun <T> case3a(x: T) {
if (x is A3 && x is B3) {
checkSubtype<A3>(x)
checkSubtype<B3>(x)
checkSubtype<T>(x)
<!DEBUG_INFO_EXPRESSION_TYPE("A3 & B3 & T!! & T")!>x<!>
}
}
fun <T: Any> case3b(x: T) {
if (x is A3 && x is B3) {
checkSubtype<A3>(x)
checkSubtype<B3>(x)
checkSubtype<T>(x)
<!DEBUG_INFO_EXPRESSION_TYPE("A3 & B3 & T & T")!>x<!>
}
}
fun <T: Any?> case3c(x: T) {
if (x is A3 && x is B3) {
checkSubtype<A3>(x)
checkSubtype<B3>(x)
checkSubtype<T>(x)
<!DEBUG_INFO_EXPRESSION_TYPE("A3 & B3 & T!! & T")!>x<!>
}
}
interface B3
interface A3
// TESTCASE NUMBER: 4
fun case4(x: C?) {
if (x is B4 && x is A4) {
x
<!DEBUG_INFO_EXPRESSION_TYPE("C & C?")!>x<!>
x.foo()
}
}
interface A4
interface B4
class C : A4, B4 {
fun foo() = ""
}
// TESTCASE NUMBER: 5
fun <T : I5> case5(x: T) {
if (x is B5 && x is A5) {
x
<!DEBUG_INFO_EXPRESSION_TYPE("B5 & A5 & T & T")!>x<!>
}
}
interface A5 : I5
interface B5 : I5
interface I5
class C5 : A5, B5 {
fun foo() = ""
}
// TESTCASE NUMBER: 6
fun <T> case6(case: T): T where T : A6?, T : B6? = case
fun <T> foo(case: T): T? = case
fun <T>test6(x: T) where T : B6? {
if (x is A6?) {
(x as C6).foo()
}
}
interface A6
interface B6
fun C6?.foo(vararg x: Int) = println("hehe")
class C6 : A6, B6 {}
@@ -0,0 +1,130 @@
// !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-464
* MAIN LINK: type-system, subtyping, subtyping-for-intersection-types -> paragraph 1 -> sentence 1
* PRIMARY LINKS: type-system, subtyping, subtyping-for-intersection-types -> paragraph 2 -> sentence 3
* NUMBER: 3
* DESCRIPTION: intersection type inferred for function
* HELPERS: checkType, functions
*/
// TESTCASE NUMBER: 1
// UNEXPECTED BEHAVIOUR
// ISSUES: KT-40074
fun case1(x: Any) {
if (x is A1 && x is B1) {
checkSubtype<A1>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<B1>(<!DEBUG_INFO_SMARTCAST!>x<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("A1 & B1 & kotlin.Any")!>x<!> // A1 & B1 & kotlin.Any
}
}
interface A1
interface B1
// TESTCASE NUMBER: 2
fun <T> case2(x: T) {
if (x is B2 && x is A2) {
checkSubtype<A2>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<B2>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<T>(x)
x //NI A2 & B2 & T & T!! OI A2 & B2 & T
<!DEBUG_INFO_EXPRESSION_TYPE("A2 & B2 & T & T!!")!>x<!>
}
}
interface A2
interface B2
// TESTCASE NUMBER: 3
fun <T> case3a(x: T) {
if (x is A3 && x is B3) {
checkSubtype<A3>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<B3>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<T>(x)
<!DEBUG_INFO_EXPRESSION_TYPE("A3 & B3 & T & T!!")!>x<!>
}
}
fun <T: Any> case3b(x: T) {
if (x is A3 && x is B3) {
checkSubtype<A3>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<B3>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<T>(x)
<!DEBUG_INFO_EXPRESSION_TYPE("A3 & B3 & T")!>x<!>
}
}
fun <T: Any?> case3c(x: T) {
if (x is A3 && x is B3) {
checkSubtype<A3>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<B3>(<!DEBUG_INFO_SMARTCAST!>x<!>)
checkSubtype<T>(x)
<!DEBUG_INFO_EXPRESSION_TYPE("A3 & B3 & T & T!!")!>x<!>
}
}
interface B3
interface A3
// TESTCASE NUMBER: 4
fun case4(x: C?) {
if (x is B4 && <!USELESS_IS_CHECK!>x is A4<!>) {
x
<!DEBUG_INFO_EXPRESSION_TYPE("A4 & B4 & C & C?")!>x<!>
<!DEBUG_INFO_SMARTCAST!>x<!>.foo()
}
}
interface A4
interface B4
class C : A4, B4 {
fun foo() = ""
}
// TESTCASE NUMBER: 5
fun <T : I5> case5(x: T) {
if (x is B5 && x is A5) {
x
<!DEBUG_INFO_EXPRESSION_TYPE("A5 & B5 & T")!>x<!>
}
}
interface A5 : I5
interface B5 : I5
interface I5
class C5 : A5, B5 {
fun foo() = ""
}
// TESTCASE NUMBER: 6
fun <T> case6(case: T): T where T : A6?, T : B6? = case
fun <T> foo(case: T): T? = case
fun <T>test6(x: T) where T : B6? {
if (x is A6?) {
(x as C6).foo()
}
}
interface A6
interface B6
fun C6?.foo(vararg x: Int) = println("hehe")
class C6 : A6, B6 {}
@@ -0,0 +1,68 @@
{
"1": {
"pos": {
"1": [
{
"specVersion": "0.1-464",
"casesNumber": 8,
"description": "intersection type inferred for parametrized functions",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.2.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "checkType, functions"
},
{
"specVersion": "0.1-464",
"casesNumber": 6,
"description": "intersection type inferred for function",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.3.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "checkType, functions"
},
{
"specVersion": "0.1-464",
"casesNumber": 2,
"description": "intersection type inferred for enum classes",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "checkType, functions"
}
]
}
},
"2": {
"pos": {
"3": [
{
"specVersion": "0.1-464",
"casesNumber": 8,
"description": "intersection type inferred for parametrized functions",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.2.kt",
"unexpectedBehaviour": false,
"linkType": "primary",
"helpers": "checkType, functions"
},
{
"specVersion": "0.1-464",
"casesNumber": 6,
"description": "intersection type inferred for function",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.3.kt",
"unexpectedBehaviour": false,
"linkType": "primary",
"helpers": "checkType, functions"
},
{
"specVersion": "0.1-464",
"casesNumber": 2,
"description": "intersection type inferred for enum classes",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary",
"helpers": "checkType, functions"
}
]
}
}
}
@@ -4754,6 +4754,11 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt");
}
@TestMetadata("2.3.kt")
public void test2_3() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.kt");
}
public void testAllFilesPresentInNeg() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@@ -5731,6 +5736,60 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping-for-nullable-types");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Subtyping_for_intersection_types extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSubtyping_for_intersection_types() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class P_1 extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInP_1() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Pos extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("1.1.kt")
public void test1_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.1.kt");
}
@TestMetadata("1.2.kt")
public void test1_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.2.kt");
}
@TestMetadata("1.3.kt")
public void test1_3() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.3.kt");
}
public void testAllFilesPresentInPos() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
}
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -4754,6 +4754,11 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS
runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt");
}
@TestMetadata("2.3.kt")
public void test2_3() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.kt");
}
public void testAllFilesPresentInNeg() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@@ -5731,6 +5736,60 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping-for-nullable-types");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Subtyping_for_intersection_types extends AbstractFirDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSubtyping_for_intersection_types() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class P_1 extends AbstractFirDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInP_1() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Pos extends AbstractFirDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("1.1.kt")
public void test1_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.1.kt");
}
@TestMetadata("1.2.kt")
public void test1_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.2.kt");
}
@TestMetadata("1.3.kt")
public void test1_3() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.3.kt");
}
public void testAllFilesPresentInPos() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
}
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)