Skip to content

Commit aa583f8

Browse files
Kotlin: keep full value class coverage focused
Replace the secondary constructor's Long conversion with a String overload. This preserves coverage for non-trivial value-class construction without exercising an unrelated primitive-conversion diagnostic. This is a test-only refinement and does not change extractor behaviour. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent dedba97 commit aa583f8

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

java/ql/test-kotlin2/library-tests/full-value-classes/test.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ properties
1010
constructors
1111
| test.kt:3:1:5:1 | Base | Base() |
1212
| test.kt:7:22:7:65 | PairValue | PairValue(int,java.lang.String) |
13-
| test.kt:8:5:8:68 | PairValue | PairValue(long) |
13+
| test.kt:8:5:8:58 | PairValue | PairValue(java.lang.String) |
1414
constructorCalls
1515
| test.kt:7:1:9:1 | super(...) | test.kt:3:1:5:1 | Base |
16-
| test.kt:8:32:8:68 | this(...) | test.kt:7:22:7:65 | PairValue |
17-
| test.kt:11:40:11:55 | new PairValue(...) | test.kt:8:5:8:68 | PairValue |
16+
| test.kt:8:34:8:58 | this(...) | test.kt:7:22:7:65 | PairValue |
17+
| test.kt:11:42:11:57 | new PairValue(...) | test.kt:8:5:8:58 | PairValue |

java/ql/test-kotlin2/library-tests/full-value-classes/test.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abstract value class Base {
55
}
66

77
value class PairValue(override val value: Int, val label: String) : Base() {
8-
constructor(value: Long) : this(value.toInt(), value.toString())
8+
constructor(value: String) : this(value.length, value)
99
}
1010

11-
fun makePairValue(value: Long): Base = PairValue(value)
11+
fun makePairValue(value: String): Base = PairValue(value)

0 commit comments

Comments
 (0)