Add 'not linked' kind of spec tests
This commit is contained in:
+31
-30
@@ -9,13 +9,13 @@ Note: diagnostic tests format specification you can see in the [diagnostic tests
|
||||
Each test relates to a specific section, paragraph, and sentence of the Kotlin language specification, and is either positive or negative.
|
||||
|
||||
The folder structure is as follows:
|
||||
* `s-<sectionNumber>_<sectionName>`
|
||||
* `<sectionName>`
|
||||
* `p-<paragraphNumber>`
|
||||
* `<neg|pos>`
|
||||
* `<setenceNumber>.<testNumber>.kt` (test source code)
|
||||
* `<setenceNumber>.<testNumber>.txt` (descriptors file)
|
||||
|
||||
Example test file path: `testsSpec/s-16.30_when-expression/p-2/neg/3.1.kt`
|
||||
Example test file path: `testData/diagnostics/linked/when-expression/p-2/neg/3.1.kt`
|
||||
|
||||
## Positive and negative tests
|
||||
|
||||
@@ -35,9 +35,9 @@ A comment with meta information has the following format:
|
||||
/*
|
||||
KOTLIN SPEC TEST (<POSITIVE|NEGATIVE>)
|
||||
|
||||
SECTION <sectionNumber>: <sectionName>
|
||||
SECTION: <sectionName>
|
||||
PARAGRAPH: <paragraphNumber>
|
||||
SENTENCE <setenceNumber>: <setence>
|
||||
SENTENCE: [<setenceNumber>] <setence>
|
||||
NUMBER: <testNumber>
|
||||
DESCRIPTION: <testDescription>
|
||||
*/
|
||||
@@ -45,17 +45,17 @@ A comment with meta information has the following format:
|
||||
Example:
|
||||
```
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION 16.30: When expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE 2: Each entry consists of a boolean condition (or a special else condition), each of which is checked and evaluated in order of appearance.
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 2
|
||||
SENTENCE: [3] When expression has two different forms: with bound value and without it.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: 'When' with not boolean condition in 'when condition'
|
||||
DESCRIPTION: Empty 'when' with bound value.
|
||||
*/
|
||||
```
|
||||
|
||||
Meta-information should be placed at the beginning of the file after diagnostic directives (if any).
|
||||
Meta-information should be placed at the beginning of the file after directives (if any).
|
||||
|
||||
### Case description
|
||||
|
||||
@@ -92,23 +92,23 @@ If the validation fails, you will receive exception about it.
|
||||
During the test run, the following information is displayed for each test:
|
||||
|
||||
```
|
||||
<POSITIVE|NEGATIVE> DIAGNOSTICS SPEC TEST
|
||||
SECTION: <sectionNumber> <sectionName> (paragraph: <paragraphNumber>)
|
||||
SENTENCE <sentenceNumber> [<specUrl>]: <sentence>
|
||||
DIAGNOSTICS <POSITIVE|NEGATIVE> SPEC TEST
|
||||
SECTION: <sectionName> (paragraph: <paragraphNumber>)
|
||||
SENTENCE <sentenceNumber>: <sentence>
|
||||
TEST NUMBER: <testNumber>
|
||||
NUMBER OF TEST CASES: <casesNumber>
|
||||
TEST CASES: <casesNumber>
|
||||
DESCRIPTION: <testDescription>
|
||||
DIAGNOSTICS: <diagnosticSeverities> | <diagnostics>
|
||||
```
|
||||
Example:
|
||||
```
|
||||
POSITIVE DIAGNOSTICS SPEC TEST
|
||||
SECTION: 16.30 When expression (paragraph: 5)
|
||||
SENTENCE 1 [http://jetbrains.github.io/kotlin-spec/#when-expression:5:1]: The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
TEST NUMBER: 4
|
||||
NUMBER OF TEST CASES: 9
|
||||
DESCRIPTION: 'When' least upper bound of the types check (when exhaustive via sealed class).
|
||||
DIAGNOSTICS: {WARNING=15} | {USELESS_IS_CHECK=1, IMPLICIT_CAST_TO_ANY=14}
|
||||
DIAGNOSTICS NEGATIVE SPEC TEST
|
||||
SECTION: when-expression (paragraph: 3)
|
||||
SENTENCE 1:
|
||||
TEST NUMBER: 1
|
||||
NUMBER OF TEST CASES: 3
|
||||
DESCRIPTION: 'When' without bound value and not allowed break and continue expression (without labels) in the control structure body.
|
||||
DIAGNOSTICS: {ERROR=2, WARNING=1} | {BREAK_OR_CONTINUE_IN_WHEN=2, UNREACHABLE_CODE=1}
|
||||
```
|
||||
|
||||
## Statistics on specification tests
|
||||
@@ -118,18 +118,19 @@ To see statistics for existing tests you can run gradle task `printSpecTestStati
|
||||
Example output:
|
||||
```
|
||||
|
||||
--------------------------------------------------
|
||||
==================================================
|
||||
SPEC TESTS STATISTIC
|
||||
--------------------------------------------------
|
||||
DIAGNOSTICS: 131 tests
|
||||
16.30 WHEN-EXPRESSION: 131 tests
|
||||
PARAGRAPH 2: 4 tests (neg: 2, pos: 2)
|
||||
PARAGRAPH 3: 35 tests (neg: 5, pos: 30)
|
||||
PARAGRAPH 4: 67 tests (neg: 11, pos: 56)
|
||||
PARAGRAPH 5: 8 tests (neg: 4, pos: 4)
|
||||
PARAGRAPH 6: 17 tests (neg: 8, pos: 9)
|
||||
PSI: 0 tests
|
||||
DIAGNOSTICS: 54 tests
|
||||
when-expression: 54 tests
|
||||
PARAGRAPH 9: 8 tests [ neg: 4 ] [ pos: 4 ]
|
||||
PARAGRAPH 7: 16 tests [ neg: 7 ] [ pos: 9 ]
|
||||
PARAGRAPH 6: 2 tests [ neg: 1 ] [ pos: 1 ]
|
||||
PARAGRAPH 11: 17 tests [ neg: 8 ] [ pos: 9 ]
|
||||
PARAGRAPH 3: 7 tests [ neg: 3 ] [ pos: 4 ]
|
||||
PARAGRAPH 2: 2 tests [ pos: 2 ]
|
||||
PARAGRAPH 5: 2 tests [ neg: 1 ] [ pos: 1 ]
|
||||
CODEGEN: 0 tests
|
||||
--------------------------------------------------
|
||||
|
||||
```
|
||||
@@ -0,0 +1,29 @@
|
||||
fun getInt(arg: Any = Any()) = arg.hashCode()
|
||||
fun getShort(arg: Any = Any()) = arg.hashCode().toShort()
|
||||
fun getLong(arg: Any = Any()) = arg.hashCode().toLong()
|
||||
fun getFloat(arg: Any = Any()) = arg.hashCode().toFloat()
|
||||
fun getDouble(arg: Any = Any()) = arg.hashCode().toDouble()
|
||||
fun getByte(arg: Any = Any()) = arg.hashCode().toByte()
|
||||
fun getChar(arg: Any = Any()) = arg.hashCode().toChar()
|
||||
fun getString(arg: Any = Any()) = arg.hashCode().toString()
|
||||
fun getBoolean(arg: Any = Any()) = arg.hashCode() % 2 == 0
|
||||
fun getNothing(): Nothing = throw Exception()
|
||||
fun getUnit() = {}
|
||||
fun getAny() = Any()
|
||||
fun getList() = mutableListOf<Int>()
|
||||
|
||||
class _BasicTypesProvider {
|
||||
fun getInt(arg: Any = Any()) = arg.hashCode()
|
||||
fun getShort(arg: Any = Any()) = arg.hashCode().toShort()
|
||||
fun getLong(arg: Any = Any()) = arg.hashCode().toLong()
|
||||
fun getFloat(arg: Any = Any()) = arg.hashCode().toFloat()
|
||||
fun getDouble(arg: Any = Any()) = arg.hashCode().toDouble()
|
||||
fun getByte(arg: Any = Any()) = arg.hashCode().toByte()
|
||||
fun getChar(arg: Any = Any()) = arg.hashCode().toChar()
|
||||
fun getString(arg: Any = Any()) = arg.hashCode().toString()
|
||||
fun getBoolean(arg: Any = Any()) = arg.hashCode() % 2 == 0
|
||||
fun getNothing(): Nothing = throw Exception()
|
||||
fun getUnit() = {}
|
||||
fun getAny() = Any()
|
||||
fun getList() = mutableListOf<Int>()
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
class _Class {
|
||||
val prop_1 = 1
|
||||
val prop_2 = 2
|
||||
val prop_3 = 3
|
||||
|
||||
fun fun_1(): (Int) -> (Int) -> Int = {number: Int -> { number * 5 }}
|
||||
fun fun_2(value_1: Int): Int = value_1 * 2
|
||||
fun fun_3(value_1: Int): (Int) -> Int = fun(value_2: Int): Int = value_1 * value_2 * 2
|
||||
|
||||
operator fun contains(a: Int): Boolean = a > 30
|
||||
operator fun contains(a: Long): Boolean = a > 30L
|
||||
operator fun contains(a: Char): Boolean = a > 30.toChar()
|
||||
|
||||
fun getIntArray(value_1: Int): IntArray = intArrayOf(1, 2, 3, value_1, 91923, 14, 123124)
|
||||
fun getLongArray(value_1: Long): LongArray = longArrayOf(1L, 2L, 3L, value_1, 9192323244L, 14L, 123124L)
|
||||
fun getCharArray(value_1: Char): CharArray = charArrayOf(1.toChar(), 2.toChar(), 3.toChar(), value_1)
|
||||
|
||||
class _NestedClass {
|
||||
val prop_4 = 4
|
||||
val prop_5 = 5
|
||||
}
|
||||
}
|
||||
|
||||
class _EmptyClass {}
|
||||
|
||||
class _ClassWithCompanionObject {
|
||||
companion object {}
|
||||
}
|
||||
|
||||
open class _ClassLevel1 {}
|
||||
open class _ClassLevel2: _ClassLevel1() {}
|
||||
open class _ClassLevel3: _ClassLevel2() {}
|
||||
open class _ClassLevel4: _ClassLevel3() {}
|
||||
open class _ClassLevel5: _ClassLevel4() {}
|
||||
class _ClassLevel6: _ClassLevel5() {}
|
||||
@@ -0,0 +1,9 @@
|
||||
enum class _EnumClass {
|
||||
NORTH, SOUTH, WEST, EAST
|
||||
}
|
||||
|
||||
enum class _EnumClassSingle {
|
||||
EVERYTHING
|
||||
}
|
||||
|
||||
enum class _EnumClassEmpty
|
||||
@@ -0,0 +1,7 @@
|
||||
fun _funWithoutArgs(): Int {
|
||||
return Any().hashCode().toInt()
|
||||
}
|
||||
|
||||
fun _funWithAnyArg(value_1: Any): Int {
|
||||
return value_1.hashCode()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
object _EmptyObject {}
|
||||
@@ -0,0 +1,36 @@
|
||||
sealed class _SealedClass
|
||||
data class _SealedChild1(val number: Int) : _SealedClass()
|
||||
data class _SealedChild2(val e1: Int, val e2: Int) : _SealedClass()
|
||||
data class _SealedChild3(val m1: Int, val m2: Int) : _SealedClass()
|
||||
|
||||
sealed class _SealedClassWithObjects
|
||||
object _SealedWithObjectsChild1 : _SealedClassWithObjects()
|
||||
object _SealedWithObjectsChild2 : _SealedClassWithObjects()
|
||||
object _SealedWithObjectsChild3 : _SealedClassWithObjects()
|
||||
|
||||
sealed class _SealedClassSingle
|
||||
data class _SealedSingleChild1(val number: Int) : _SealedClassSingle()
|
||||
|
||||
sealed class _SealedClassSingleWithObject
|
||||
object _SealedSingleWithObjectChild1: Expr3() {}
|
||||
|
||||
sealed class _SealedClassEmpty
|
||||
|
||||
sealed class _SealedClassWithMethods
|
||||
class _SealedWithMethodsChild1() : _SealedClassWithMethods() {
|
||||
fun m1() = this.hashCode().toString()
|
||||
}
|
||||
class _SealedWithMethodsChild2() : _SealedClassWithMethods() {
|
||||
fun m2() = this.hashCode().toString()
|
||||
}
|
||||
class _SealedWithMethodsChild3() : _SealedClassWithMethods() {
|
||||
fun m3() = this.hashCode().toString()
|
||||
}
|
||||
|
||||
sealed class _SealedClassMixed
|
||||
data class _SealedMixedChild1(val number: Int) : _SealedClassMixed()
|
||||
data class _SealedMixedChild2(val e1: Int, val e2: Int) : _SealedClassMixed()
|
||||
data class _SealedMixedChild3(val m1: Int, val m2: Int) : _SealedClassMixed()
|
||||
object _SealedMixedChildObject1 : _SealedClassMixed()
|
||||
object _SealedMixedChildObject2 : _SealedClassMixed()
|
||||
object _SealedMixedChildObject3 : _SealedClassMixed()
|
||||
@@ -0,0 +1,4 @@
|
||||
typealias _TypeAliasAny = Any
|
||||
typealias _TypeAliasUnit = Unit
|
||||
typealias _TypeAliasNothing = Nothing
|
||||
typealias _TypeAliasInt = Int
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [1] It has an else entry;
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [1] It has an else entry;
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [3] The bound expression is of type kotlin.Boolean and the conditions contain both:
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [6] The bound expression is of a sealed class type and all its possible subtypes are covered using type test conditions of this expression;
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [7] The bound expression is of an Enum classes type and all enumerated values are checked for equality using constant conditions;
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [8] The bound expression is of a nullable type and one of the cases above is met for its non-nullable counterpart and, in addition, there is a condition containing literal null.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [8] The bound expression is of a nullable type and one of the cases above is met for its non-nullable counterpart and, in addition, there is a condition containing literal null.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [8] The bound expression is of a nullable type and one of the cases above is met for its non-nullable counterpart and, in addition, there is a condition containing literal null.
|
||||
NUMBER: 3
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [1] It has an else entry;
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [1] It has an else entry;
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [1] It has an else entry;
|
||||
NUMBER: 3
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [3] The bound expression is of type kotlin.Boolean and the conditions contain both:
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When valueession
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [6] The bound valueession is of a sealed class type and all its possible subtypes are covered using type test conditions of this valueession;
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [7] The bound expression is of an Enum classes type and all enumerated values are checked for equality using constant conditions;
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [8] The bound expression is of a nullable type and one of the cases above is met for its non-nullable counterpart and, in addition, there is a condition containing literal null.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [8] The bound expression is of a nullable type and one of the cases above is met for its non-nullable counterpart and, in addition, there is a condition containing literal null.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 11
|
||||
SENTENCE: [8] The bound expression is of a nullable type and one of the cases above is met for its non-nullable counterpart and, in addition, there is a condition containing literal null.
|
||||
NUMBER: 3
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 2
|
||||
SENTENCE: [3] When expression has two different forms: with bound value and without it.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 2
|
||||
SENTENCE: [3] When expression has two different forms: with bound value and without it.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE: [1] When expression without bound value (the form where the expression enclosed in parantheses is absent) evaluates one of the many different expressions based on corresponding conditions present in the same when entry.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE: [2] Each entry consists of a boolean condition (or a special else condition), each of which is checked and evaluated in order of appearance.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE: [2] Each entry consists of a boolean condition (or a special else condition), each of which is checked and evaluated in order of appearance.
|
||||
NUMBER: 2
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -DEBUG_INFO_SMARTCAST
|
||||
// !WITH_BASIC_TYPES
|
||||
// !WITH_CLASSES
|
||||
// !WITH_FUNS
|
||||
// !WITH_FUNCTIONS
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE: [1] When expression without bound value (the form where the expression enclosed in parantheses is absent) evaluates one of the many different expressions based on corresponding conditions present in the same when entry.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE: [2] Each entry consists of a boolean condition (or a special else condition), each of which is checked and evaluated in order of appearance.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE: [2] Each entry consists of a boolean condition (or a special else condition), each of which is checked and evaluated in order of appearance.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 3
|
||||
SENTENCE: [2] Each entry consists of a boolean condition (or a special else condition), each of which is checked and evaluated in order of appearance.
|
||||
NUMBER: 3
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 5
|
||||
SENTENCE: [1] The else entry is also special in the sense that it must be the last entry in the expression, otherwise a compiler error must be generated.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 5
|
||||
SENTENCE: [1] The else entry is also special in the sense that it must be the last entry in the expression, otherwise a compiler error must be generated.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 6
|
||||
SENTENCE: [1] When expression with bound value (the form where the expression enclosed in parantheses is present) are very similar to the form without bound value, but use different syntax for conditions.
|
||||
NUMBER: 1
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// !WITH_BASIC_TYPES
|
||||
// !WITH_FUNS
|
||||
// !WITH_FUNCTIONS
|
||||
// !WITH_CLASSES
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 6
|
||||
SENTENCE: [1] When expression with bound value (the form where the expression enclosed in parantheses is present) are very similar to the form without bound value, but use different syntax for conditions.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [1] Type test condition: type checking operator followed by type.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [1] Type test condition: type checking operator followed by type.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [3] Contains test condition: containment operator followed by an expression.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [3] Contains test condition: containment operator followed by an expression.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [5] Any other expression.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [5] Any other expression.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [7] The else condition, which works the exact same way as it would in the form without bound expression.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [1] Type test condition: type checking operator followed by type.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [1] Type test condition: type checking operator followed by type.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [1] Type test condition: type checking operator followed by type.
|
||||
NUMBER: 3
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [1] Type test condition: type checking operator followed by type.
|
||||
NUMBER: 4
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [3] Contains test condition: containment operator followed by an expression.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [3] Contains test condition: containment operator followed by an expression.
|
||||
NUMBER: 2
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
// !WITH_BASIC_TYPES
|
||||
// !WITH_FUNS
|
||||
// !WITH_FUNCTIONS
|
||||
// !WITH_CLASSES
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [5] Any other expression.
|
||||
NUMBER: 1
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
// !WITH_BASIC_TYPES
|
||||
// !WITH_CLASSES
|
||||
// !WITH_FUNS
|
||||
// !WITH_FUNCTIONS
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [5] Any other expression.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 7
|
||||
SENTENCE: [7] The else condition, which works the exact same way as it would in the form without bound expression.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 3
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 4
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 1
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 2
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 3
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTION: 16.30 When expression
|
||||
SECTION: when-expression
|
||||
PARAGRAPH: 9
|
||||
SENTENCE: [1] The type of the resulting expression is the least upper bound of the types of all the entries.
|
||||
NUMBER: 4
|
||||
Reference in New Issue
Block a user