Skip to content

Commit 547feab

Browse files
committed
C#: Add a partial method example with a body.
1 parent 6e8f43c commit 547feab

11 files changed

+168
-145
lines changed
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
| Partial.cs:6:18:6:42 | PartialMethodWithoutBody1 | true |
2-
| Partial.cs:7:17:7:23 | Method2 | false |
3-
| Partial.cs:18:18:18:39 | PartialMethodWithBody1 | true |
4-
| Partial.cs:19:17:19:23 | Method3 | false |
5-
| Partial.cs:41:18:41:42 | PartialMethodWithoutBody2 | true |
6-
| Partial.cs:42:17:42:23 | Method4 | false |
7-
| Partial.cs:47:17:47:23 | Method5 | false |
1+
| Partial.cs:7:18:7:42 | PartialMethodWithoutBody1 | true |
2+
| Partial.cs:8:17:8:23 | Method2 | false |
3+
| Partial.cs:19:18:19:39 | PartialMethodWithBody1 | true |
4+
| Partial.cs:20:27:20:48 | PartialMethodWithBody2 | true |
5+
| Partial.cs:24:17:24:23 | Method3 | false |
6+
| Partial.cs:46:18:46:42 | PartialMethodWithoutBody2 | true |
7+
| Partial.cs:47:17:47:23 | Method4 | false |
8+
| Partial.cs:52:17:52:23 | Method5 | false |

csharp/ql/test/library-tests/partial/Partial.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
partial class TwoPartClass
44
{
55
partial void PartialMethodWithBody1();
6+
public partial object PartialMethodWithBody2(object obj);
67
partial void PartialMethodWithoutBody1();
78
public void Method2() { }
89
// Declaring declaration.
@@ -16,6 +17,10 @@ public void Method2() { }
1617
partial class TwoPartClass
1718
{
1819
partial void PartialMethodWithBody1() { }
20+
public partial object PartialMethodWithBody2(object obj)
21+
{
22+
return obj;
23+
}
1924
public void Method3() { }
2025
private object _backingField;
2126
// Implementation declaration.
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
| Partial.cs:3:15:3:26 | TwoPartClass |
2-
| Partial.cs:6:18:6:42 | PartialMethodWithoutBody1 |
3-
| Partial.cs:16:15:16:26 | TwoPartClass |
4-
| Partial.cs:18:18:18:39 | PartialMethodWithBody1 |
5-
| Partial.cs:22:27:22:42 | PartialProperty1 |
6-
| Partial.cs:24:9:24:11 | get_PartialProperty1 |
7-
| Partial.cs:25:9:25:11 | set_PartialProperty1 |
8-
| Partial.cs:29:27:29:30 | Item |
9-
| Partial.cs:31:9:31:11 | get_Item |
10-
| Partial.cs:32:9:32:11 | set_Item |
11-
| Partial.cs:36:39:36:51 | PartialEvent1 |
12-
| Partial.cs:36:55:36:57 | add_PartialEvent1 |
13-
| Partial.cs:36:63:36:68 | remove_PartialEvent1 |
14-
| Partial.cs:39:15:39:33 | OnePartPartialClass |
15-
| Partial.cs:41:18:41:42 | PartialMethodWithoutBody2 |
2+
| Partial.cs:7:18:7:42 | PartialMethodWithoutBody1 |
3+
| Partial.cs:17:15:17:26 | TwoPartClass |
4+
| Partial.cs:19:18:19:39 | PartialMethodWithBody1 |
5+
| Partial.cs:20:27:20:48 | PartialMethodWithBody2 |
6+
| Partial.cs:27:27:27:42 | PartialProperty1 |
7+
| Partial.cs:29:9:29:11 | get_PartialProperty1 |
8+
| Partial.cs:30:9:30:11 | set_PartialProperty1 |
9+
| Partial.cs:34:27:34:30 | Item |
10+
| Partial.cs:36:9:36:11 | get_Item |
11+
| Partial.cs:37:9:37:11 | set_Item |
12+
| Partial.cs:41:39:41:51 | PartialEvent1 |
13+
| Partial.cs:41:55:41:57 | add_PartialEvent1 |
14+
| Partial.cs:41:63:41:68 | remove_PartialEvent1 |
15+
| Partial.cs:44:15:44:33 | OnePartPartialClass |
16+
| Partial.cs:46:18:46:42 | PartialMethodWithoutBody2 |
1617
| PartialMultipleFiles1.cs:1:22:1:41 | PartialMultipleFiles |
1718
| PartialMultipleFiles2.cs:1:22:1:41 | PartialMultipleFiles |
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:3:15:3:26 | <object initializer> |
2-
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:6:18:6:42 | PartialMethodWithoutBody1 |
3-
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:7:17:7:23 | Method2 |
4-
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:18:18:18:39 | PartialMethodWithBody1 |
5-
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:19:17:19:23 | Method3 |
6-
| Partial.cs:16:15:16:26 | TwoPartClass | Partial.cs:3:15:3:26 | <object initializer> |
7-
| Partial.cs:16:15:16:26 | TwoPartClass | Partial.cs:6:18:6:42 | PartialMethodWithoutBody1 |
8-
| Partial.cs:16:15:16:26 | TwoPartClass | Partial.cs:7:17:7:23 | Method2 |
9-
| Partial.cs:16:15:16:26 | TwoPartClass | Partial.cs:18:18:18:39 | PartialMethodWithBody1 |
10-
| Partial.cs:16:15:16:26 | TwoPartClass | Partial.cs:19:17:19:23 | Method3 |
11-
| Partial.cs:39:15:39:33 | OnePartPartialClass | Partial.cs:39:15:39:33 | <object initializer> |
12-
| Partial.cs:39:15:39:33 | OnePartPartialClass | Partial.cs:41:18:41:42 | PartialMethodWithoutBody2 |
13-
| Partial.cs:39:15:39:33 | OnePartPartialClass | Partial.cs:42:17:42:23 | Method4 |
2+
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:7:18:7:42 | PartialMethodWithoutBody1 |
3+
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:8:17:8:23 | Method2 |
4+
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:19:18:19:39 | PartialMethodWithBody1 |
5+
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:20:27:20:48 | PartialMethodWithBody2 |
6+
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:24:17:24:23 | Method3 |
7+
| Partial.cs:17:15:17:26 | TwoPartClass | Partial.cs:3:15:3:26 | <object initializer> |
8+
| Partial.cs:17:15:17:26 | TwoPartClass | Partial.cs:7:18:7:42 | PartialMethodWithoutBody1 |
9+
| Partial.cs:17:15:17:26 | TwoPartClass | Partial.cs:8:17:8:23 | Method2 |
10+
| Partial.cs:17:15:17:26 | TwoPartClass | Partial.cs:19:18:19:39 | PartialMethodWithBody1 |
11+
| Partial.cs:17:15:17:26 | TwoPartClass | Partial.cs:20:27:20:48 | PartialMethodWithBody2 |
12+
| Partial.cs:17:15:17:26 | TwoPartClass | Partial.cs:24:17:24:23 | Method3 |
13+
| Partial.cs:44:15:44:33 | OnePartPartialClass | Partial.cs:44:15:44:33 | <object initializer> |
14+
| Partial.cs:44:15:44:33 | OnePartPartialClass | Partial.cs:46:18:46:42 | PartialMethodWithoutBody2 |
15+
| Partial.cs:44:15:44:33 | OnePartPartialClass | Partial.cs:47:17:47:23 | Method4 |
1416
| PartialMultipleFiles1.cs:1:22:1:41 | PartialMultipleFiles | PartialMultipleFiles1.cs:1:22:1:41 | <object initializer> |
1517
| PartialMultipleFiles2.cs:1:22:1:41 | PartialMultipleFiles | PartialMultipleFiles1.cs:1:22:1:41 | <object initializer> |
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
| Partial.cs:24:9:24:11 | get_PartialProperty1 | true |
2-
| Partial.cs:25:9:25:11 | set_PartialProperty1 | true |
3-
| Partial.cs:31:9:31:11 | get_Item | true |
4-
| Partial.cs:32:9:32:11 | set_Item | true |
5-
| Partial.cs:36:55:36:57 | add_PartialEvent1 | true |
6-
| Partial.cs:36:63:36:68 | remove_PartialEvent1 | true |
7-
| Partial.cs:48:30:48:32 | get_Property | false |
8-
| Partial.cs:48:35:48:37 | set_Property | false |
9-
| Partial.cs:51:9:51:11 | get_Item | false |
10-
| Partial.cs:52:9:52:11 | set_Item | false |
11-
| Partial.cs:54:31:54:35 | add_Event | false |
12-
| Partial.cs:54:31:54:35 | remove_Event | false |
1+
| Partial.cs:29:9:29:11 | get_PartialProperty1 | true |
2+
| Partial.cs:30:9:30:11 | set_PartialProperty1 | true |
3+
| Partial.cs:36:9:36:11 | get_Item | true |
4+
| Partial.cs:37:9:37:11 | set_Item | true |
5+
| Partial.cs:41:55:41:57 | add_PartialEvent1 | true |
6+
| Partial.cs:41:63:41:68 | remove_PartialEvent1 | true |
7+
| Partial.cs:53:30:53:32 | get_Property | false |
8+
| Partial.cs:53:35:53:37 | set_Property | false |
9+
| Partial.cs:56:9:56:11 | get_Item | false |
10+
| Partial.cs:57:9:57:11 | set_Item | false |
11+
| Partial.cs:59:31:59:35 | add_Event | false |
12+
| Partial.cs:59:31:59:35 | remove_Event | false |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
| Partial.cs:3:15:3:26 | TwoPartClass | Partial.cs:3:15:3:26 | {...} |
2-
| Partial.cs:39:15:39:33 | OnePartPartialClass | Partial.cs:39:15:39:33 | {...} |
3-
| Partial.cs:45:7:45:21 | NonPartialClass | Partial.cs:45:7:45:21 | {...} |
2+
| Partial.cs:44:15:44:33 | OnePartPartialClass | Partial.cs:44:15:44:33 | {...} |
3+
| Partial.cs:50:7:50:21 | NonPartialClass | Partial.cs:50:7:50:21 | {...} |
44
| PartialMultipleFiles1.cs:1:22:1:41 | PartialMultipleFiles | PartialMultipleFiles1.cs:1:22:1:41 | {...} |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Partial.cs:36:39:36:51 | PartialEvent1 | true |
2-
| Partial.cs:54:31:54:35 | Event | false |
1+
| Partial.cs:41:39:41:51 | PartialEvent1 | true |
2+
| Partial.cs:59:31:59:35 | Event | false |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Partial.cs:29:27:29:30 | Item | true |
2-
| Partial.cs:49:19:49:22 | Item | false |
1+
| Partial.cs:34:27:34:30 | Item | true |
2+
| Partial.cs:54:19:54:22 | Item | false |
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
| Partial.cs:6:18:6:42 | PartialMethodWithoutBody1 | false |
2-
| Partial.cs:18:18:18:39 | PartialMethodWithBody1 | true |
3-
| Partial.cs:41:18:41:42 | PartialMethodWithoutBody2 | false |
1+
| Partial.cs:7:18:7:42 | PartialMethodWithoutBody1 | false |
2+
| Partial.cs:19:18:19:39 | PartialMethodWithBody1 | true |
3+
| Partial.cs:20:27:20:48 | PartialMethodWithBody2 | true |
4+
| Partial.cs:46:18:46:42 | PartialMethodWithoutBody2 | false |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Partial.cs:22:27:22:42 | PartialProperty1 | true |
2-
| Partial.cs:48:19:48:26 | Property | false |
1+
| Partial.cs:27:27:27:42 | PartialProperty1 | true |
2+
| Partial.cs:53:19:53:26 | Property | false |

0 commit comments

Comments
 (0)