[Spec tests] Link diagnostic tests for when expression with Kotlin specification
This commit is contained in:
committed by
Victor Petukhov
parent
c338fdd677
commit
2dbce2cc41
@@ -1,4 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
* - annotations, annotation-targets -> paragraph 1 -> sentence 1
|
||||
*/
|
||||
fun foo(a: Int) {
|
||||
@ann
|
||||
when (a) {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 6
|
||||
*/
|
||||
class A
|
||||
|
||||
fun test(a: Any): String {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 8
|
||||
*/
|
||||
class A
|
||||
|
||||
fun test(a: Any) {
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 8
|
||||
*/
|
||||
enum class My { A, B }
|
||||
|
||||
fun test(a: My): String {
|
||||
@@ -7,6 +15,6 @@ fun test(a: My): String {
|
||||
My.A -> q = "1"
|
||||
My.B -> q = "2"
|
||||
}<!>
|
||||
// When is exhaustive
|
||||
// When is exhaustives
|
||||
return <!DEBUG_INFO_SMARTCAST!>q<!>
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 8
|
||||
*/
|
||||
class A
|
||||
|
||||
fun test(a: Any): String {
|
||||
@@ -7,6 +15,6 @@ fun test(a: Any): String {
|
||||
is A -> q = "1"
|
||||
else -> q = "2"
|
||||
}
|
||||
// When is not exhaustive
|
||||
// When is exhaustives
|
||||
return <!DEBUG_INFO_SMARTCAST!>q<!>
|
||||
}
|
||||
|
||||
+5
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
*/
|
||||
fun foo(x: Int, y: Int): Int =
|
||||
when {
|
||||
x > 0<!COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT!>,<!> y > 0<!COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT!>,<!><!SYNTAX!>,<!> x < 0 -> 1
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 4
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 5
|
||||
*/
|
||||
|
||||
package test
|
||||
|
||||
const val four = 4
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// KT-2902 Check for null should be required when match nullable enum element
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
*/
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
*/
|
||||
|
||||
enum class E { A, B }
|
||||
|
||||
fun foo(e: E, something: Any?): Int {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 1 -> sentence 2
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
*/
|
||||
|
||||
// EA-68871: empty when condition
|
||||
fun foo(arg: Int): Int {
|
||||
when (arg) {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 1 -> sentence 2
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
*/
|
||||
|
||||
// EA-68871: empty when condition
|
||||
enum class My { FIRST, SECOND }
|
||||
fun foo(arg: My): Int {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
|
||||
*/
|
||||
|
||||
// See also: KT-3743
|
||||
fun foo(arg: Boolean): String {
|
||||
// Must be exhaustive
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
|
||||
*/
|
||||
|
||||
fun foo(arg: Boolean): String {
|
||||
// Must be exhaustive
|
||||
return when(arg) {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
|
||||
*/
|
||||
|
||||
// See also: KT-3743
|
||||
fun foo(arg: Boolean): String {
|
||||
// Must be exhaustive
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
*/
|
||||
|
||||
// See also: KT-3743
|
||||
fun foo(arg: Boolean?): String {
|
||||
// Must be exhaustive
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
|
||||
* - control--and-data-flow-analysis, control-flow-graph, statements-1 -> paragraph 0 -> sentence 0
|
||||
*/
|
||||
|
||||
enum class Color { RED, GREEN, BLUE }
|
||||
|
||||
fun foo(arr: Array<Color>): Color {
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
*/
|
||||
|
||||
enum class MyEnum {
|
||||
A, B, C
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
*/
|
||||
|
||||
enum class MyEnum {
|
||||
A, B, C
|
||||
}
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
*/
|
||||
|
||||
enum class Direction {
|
||||
NORTH, SOUTH, WEST, EAST
|
||||
}
|
||||
@@ -12,4 +21,4 @@ fun foo(dir: Direction): Int {
|
||||
Direction.EAST -> res = 4
|
||||
}<!>
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
*/
|
||||
|
||||
fun foo(b: Boolean): Int {
|
||||
val x: Int
|
||||
val y: Int
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
*/
|
||||
|
||||
enum class MyEnum {
|
||||
A, B
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
*/
|
||||
|
||||
// See KT-6399: exhaustive whens on platform enums
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
*/
|
||||
|
||||
// See KT-6399: exhaustive whens on platform enums
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
*/
|
||||
|
||||
// See KT-6399: exhaustive whens on platform enums
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
*/
|
||||
|
||||
// See KT-6399: exhaustive whens on platform enums
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
*/
|
||||
|
||||
// See KT-6399: exhaustive whens on platform enums
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
|
||||
*/
|
||||
|
||||
enum class Direction {
|
||||
NORTH, SOUTH, WEST, EAST
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
|
||||
*/
|
||||
|
||||
enum class Direction {
|
||||
NORTH, SOUTH, WEST, EAST
|
||||
}
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 3
|
||||
*/
|
||||
|
||||
fun foo(a: Boolean, b: Boolean): Int {
|
||||
val x: Int
|
||||
if (a) {
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
|
||||
*/
|
||||
|
||||
fun foo(a: Boolean, b: Boolean): Int {
|
||||
var x: Int
|
||||
if (a) {
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
*/
|
||||
|
||||
// KT-7857: when exhaustiveness does not take previous nullability checks into account
|
||||
enum class X { A, B }
|
||||
fun foo(arg: X?): Int {
|
||||
|
||||
+9
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
|
||||
*/
|
||||
|
||||
// KT-7857: when exhaustiveness does not take previous nullability checks into account
|
||||
enum class X { A, B }
|
||||
fun foo(arg: X?): Int {
|
||||
|
||||
+9
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
*/
|
||||
|
||||
// KT-7857: when exhaustiveness does not take previous nullability checks into account
|
||||
fun foo(arg: Boolean?): Int {
|
||||
if (arg != null) {
|
||||
|
||||
+9
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
|
||||
*/
|
||||
|
||||
// KT-7857: when exhaustiveness does not take previous nullability checks into account
|
||||
enum class X { A, B }
|
||||
fun foo(arg: X?): Int {
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
*/
|
||||
|
||||
fun foo(x: Int) {
|
||||
val y: Unit = <!NO_ELSE_IN_WHEN!>when<!> (x) {
|
||||
2 -> {}
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
*/
|
||||
|
||||
fun foo(x: Int): Any {
|
||||
val v = <!NO_ELSE_IN_WHEN!>when<!> (x) {
|
||||
2 -> 0
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, function-literals, lambda-literals -> paragraph 10 -> sentence 1
|
||||
*/
|
||||
|
||||
fun foo(x: Int) {
|
||||
r {
|
||||
when (x) {
|
||||
|
||||
+9
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, function-literals, lambda-literals -> paragraph 10 -> sentence 1
|
||||
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 3 -> sentence 3
|
||||
*/
|
||||
|
||||
fun foo(x: Int) {
|
||||
r {
|
||||
<!NO_ELSE_IN_WHEN!>when<!> (x) {
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
*/
|
||||
|
||||
fun foo(x: Int): Any {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!> (x) {
|
||||
2 -> 0
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
*/
|
||||
|
||||
|
||||
fun foo(x: Int) {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!> (x) {
|
||||
2 -> {}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
*/
|
||||
|
||||
fun foo(x: Int) {
|
||||
when (x) {
|
||||
2 -> {}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
*/
|
||||
|
||||
// See also: KT-3743
|
||||
fun foo(arg: Boolean?): String {
|
||||
// Must be NOT exhaustive
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
*/
|
||||
|
||||
// See KT-6399: exhaustive whens on platform enums
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
*/
|
||||
|
||||
// Base for KT-6227
|
||||
enum class X { A, B, C, D }
|
||||
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
|
||||
*/
|
||||
|
||||
// Base for KT-6227
|
||||
enum class X { A, B, C, D }
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
|
||||
*/
|
||||
|
||||
// Base for KT-6227
|
||||
enum class X { A, B, C, D }
|
||||
|
||||
|
||||
+11
@@ -1,3 +1,14 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 7
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 3 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
*/
|
||||
|
||||
sealed class S
|
||||
|
||||
object First : S()
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
*/
|
||||
|
||||
// Base for KT-6227
|
||||
enum class X { A, B, C, D }
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 2
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
*/
|
||||
|
||||
// KT-7857: when exhaustiveness does not take previous nullability checks into account
|
||||
enum class X { A, B }
|
||||
fun foo(arg: X?): Int {
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
|
||||
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
|
||||
* - declarations, classifier-declaration, classifier-initialization -> paragraph 6 -> sentence 4
|
||||
*/
|
||||
|
||||
// See KT-5113
|
||||
enum class E {
|
||||
A,
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 10
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 11
|
||||
*/
|
||||
|
||||
// FILE: MyEnum.java
|
||||
public enum MyEnum {
|
||||
SINGLE;
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
*/
|
||||
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
infix fun Any.sealed(a: Any?) {}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 7
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 8
|
||||
*/
|
||||
|
||||
sealed class A {
|
||||
class B: A() {
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 5
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 3
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 9
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 10
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 11
|
||||
*/
|
||||
|
||||
fun Int.foo() : Boolean = true
|
||||
|
||||
fun foo() : Int {
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
|
||||
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
|
||||
*/
|
||||
|
||||
fun foo(s: Any): String {
|
||||
val x = when (s) {
|
||||
is String -> <!DEBUG_INFO_SMARTCAST!>s<!>
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 1
|
||||
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
|
||||
* - expressions, conditional-expression -> paragraph 5 -> sentence 1
|
||||
* - overload-resolution, determining-function-applicability-for-a-specific-call, rationale -> paragraph 1 -> sentence 1
|
||||
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 3 -> sentence 1
|
||||
*/
|
||||
|
||||
fun foo(x: Int) = x
|
||||
|
||||
fun test0(flag: Boolean) {
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEBUG_INFO_SMARTCAST
|
||||
// NI_EXPECTED_FILE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
|
||||
* - declarations, function-declaration -> paragraph 7 -> sentence 1
|
||||
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
|
||||
* - type-system, type-kinds, type-parameters -> paragraph 4 -> sentence 1
|
||||
* - type-inference, local-type-inference -> paragraph 8 -> sentence 1
|
||||
* - type-inference, local-type-inference -> paragraph 2 -> sentence 1
|
||||
*/
|
||||
|
||||
interface Data
|
||||
interface Item
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
|
||||
* - type-inference, local-type-inference -> paragraph 8 -> sentence 1
|
||||
* - type-inference, local-type-inference -> paragraph 2 -> sentence 1
|
||||
* - type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 3
|
||||
* - type-system, subtyping, subtyping-for-nullable-types -> paragraph 4 -> sentence 1
|
||||
* - type-system, subtyping, subtyping-for-nullable-types -> paragraph 4 -> sentence 2
|
||||
*/
|
||||
|
||||
interface Maybe<T>
|
||||
class Some<T>(val value: T) : Maybe<T>
|
||||
class None<T> : Maybe<T>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 5 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
*/
|
||||
|
||||
// KT-4434 Missed diagnostic about else branch in when
|
||||
|
||||
package test
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression -> paragraph 9 -> sentence 1
|
||||
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
|
||||
* - expressions, conditional-expression -> paragraph 5 -> sentence 1
|
||||
*/
|
||||
|
||||
fun test1(): Int {
|
||||
val x: String = <!NI;TYPE_MISMATCH!>if (true) {
|
||||
when {
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 1
|
||||
* - type-inference, local-type-inference -> paragraph 2 -> sentence 1
|
||||
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 3 -> sentence 3
|
||||
*/
|
||||
|
||||
val test1: (String) -> Boolean =
|
||||
when {
|
||||
true -> {{ true }}
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
// NI_EXPECTED_FILE
|
||||
/*
|
||||
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
|
||||
* - expressions, when-expression -> paragraph 2 -> sentence 1
|
||||
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
|
||||
* - declarations, function-declaration -> paragraph 7 -> sentence 1
|
||||
* - declarations, function-declaration -> paragraph 7 -> sentence 2
|
||||
* - declarations, function-declaration -> paragraph 8 -> sentence 1
|
||||
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 1 -> sentence 3
|
||||
*/
|
||||
|
||||
val <!OI;IMPLICIT_NOTHING_PROPERTY_TYPE!>test1<!> = when {
|
||||
true -> { <!OI;TYPE_MISMATCH!>{ true }<!> }
|
||||
else -> TODO()
|
||||
|
||||
Reference in New Issue
Block a user