Skip to content

Commit a51c2c4

Browse files
tamasvajksmowton
authored andcommitted
Add test with colliding property accessor and function names
1 parent 857a74c commit a51c2c4

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| properties.kt:84:13:84:29 | <set-?> | Parameter | -1 | duplicate | -1 |
2+
| properties.kt:84:13:84:29 | p | Parameter | -1 | duplicate | -1 |
3+
| properties.kt:86:17:86:22 | <set-?> | Parameter | -1 | duplicate | -1 |
4+
| properties.kt:86:17:86:22 | p | Parameter | -1 | duplicate | -1 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| Top which doesn't have exactly 1 toString |
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[INVALID_KEY] predicate paramName(@param id, string nodeName): The key set {id} does not functionally determine all fields.
2+
Here is a pair of tuples that agree on the key set but differ at index 1:
3+
Tuple 1 in row 14: (747,"<set-?>")
4+
Tuple 2 in row 15: (747,"p")
5+
Relevant element: Tuple 1: id=747
6+
Full ID for 747: @"params;(746);0". The ID may expand to @"params;{@"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"};0"
7+
Relevant element: Tuple 2: id=747
8+
Full ID for 747: @"params;(746);0". The ID may expand to @"params;{@"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"};0"
9+
[INVALID_KEY_SET] predicate stmts(@stmt id, int kind, @stmtparent parent, int idx, @callable bodydecl): The key set {parent, idx} does not functionally determine all fields.
10+
Here is a pair of tuples that agree on the key set but differ at index 0:
11+
Tuple 1 in row 106: (750,0,746,0,746)
12+
Tuple 2 in row 108: (762,0,746,0,746)
13+
Relevant element: Tuple 1: parent=746
14+
Full ID for 746: @"callable;(725).setData((17))(22)". The ID may expand to @"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"
15+
Relevant element: Tuple 2: parent=746
16+
Full ID for 746: @"callable;(725).setData((17))(22)". The ID may expand to @"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"
17+
Relevant element: Tuple 1: bodydecl=746
18+
Full ID for 746: @"callable;(725).setData((17))(22)". The ID may expand to @"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"
19+
Relevant element: Tuple 2: bodydecl=746
20+
Full ID for 746: @"callable;(725).setData((17))(22)". The ID may expand to @"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"
21+
[INVALID_KEY_SET] predicate exprs(@expr id, int kind, @type typeid, @exprparent parent, int idx): The key set {parent, idx} does not functionally determine all fields.
22+
Here is a pair of tuples that agree on the key set but differ at index 0:
23+
Tuple 1 in row 303: (749,62,23,746,-1)
24+
Tuple 2 in row 310: (761,62,23,746,-1)
25+
Relevant element: typeid=23
26+
Full ID for 23: @"class;kotlin.Unit"
27+
Relevant element: Tuple 1: parent=746
28+
Full ID for 746: @"callable;(725).setData((17))(22)". The ID may expand to @"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"
29+
Relevant element: Tuple 2: parent=746
30+
Full ID for 746: @"callable;(725).setData((17))(22)". The ID may expand to @"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"
31+
[INVALID_KEY_SET] predicate exprs(@expr id, int kind, @type typeid, @exprparent parent, int idx): The key set {parent, idx} does not functionally determine all fields.
32+
Here is a pair of tuples that agree on the key set but differ at index 0:
33+
Tuple 1 in row 302: (748,62,17,747,-1)
34+
Tuple 2 in row 309: (759,62,17,747,-1)
35+
Relevant element: typeid=17
36+
Full ID for 17: @"type;int"
37+
Relevant element: Tuple 1: parent=747
38+
Full ID for 747: @"params;(746);0". The ID may expand to @"params;{@"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"};0"
39+
Relevant element: Tuple 2: parent=747
40+
Full ID for 747: @"params;(746);0". The ID may expand to @"params;{@"callable;{@"class;A"}.setData({@"type;int"}){@"type;void"}"};0"

java/ql/test/kotlin/library-tests/properties/properties.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fieldDeclarations
2020
| properties.kt:38:5:38:34 | int internalProp; | properties.kt:38:5:38:34 | internalProp | 0 |
2121
| properties.kt:67:1:67:23 | int constVal; | properties.kt:67:1:67:23 | constVal | 0 |
2222
| properties.kt:70:5:70:16 | int prop; | properties.kt:70:5:70:16 | prop | 0 |
23+
| properties.kt:84:5:84:29 | int data; | properties.kt:84:5:84:29 | data | 0 |
2324
#select
2425
| properties.kt:2:27:2:50 | constructorProp | properties.kt:2:27:2:50 | getConstructorProp | file://:0:0:0:0 | <none> | properties.kt:2:27:2:50 | constructorProp | public |
2526
| properties.kt:2:53:2:83 | mutableConstructorProp | properties.kt:2:53:2:83 | getMutableConstructorProp | properties.kt:2:53:2:83 | setMutableConstructorProp | properties.kt:2:53:2:83 | mutableConstructorProp | public |
@@ -48,3 +49,5 @@ fieldDeclarations
4849
| properties.kt:70:5:70:16 | prop | properties.kt:70:5:70:16 | getProp | file://:0:0:0:0 | <none> | properties.kt:70:5:70:16 | prop | public |
4950
| properties.kt:78:1:79:13 | x | properties.kt:79:5:79:13 | getX | file://:0:0:0:0 | <none> | file://:0:0:0:0 | <none> | public |
5051
| properties.kt:80:1:81:13 | x | properties.kt:81:5:81:13 | getX | file://:0:0:0:0 | <none> | file://:0:0:0:0 | <none> | public |
52+
| properties.kt:84:5:84:29 | data | properties.kt:84:13:84:29 | getData | properties.kt:84:13:84:29 | setData | properties.kt:84:5:84:29 | data | private |
53+
| properties.kt:84:5:84:29 | data | properties.kt:84:13:84:29 | getData | properties.kt:86:5:88:5 | setData | properties.kt:84:5:84:29 | data | private |

java/ql/test/kotlin/library-tests/properties/properties.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,11 @@ val Int.x : Int
7979
get() = 5
8080
val Double.x : Int
8181
get() = 5
82+
83+
class A {
84+
private var data: Int = 0
85+
86+
fun setData(p: Int) {
87+
data = p
88+
}
89+
}

0 commit comments

Comments
 (0)