forked fromdotnet/fsharp
- Notifications
You must be signed in to change notification settings - Fork0
Commit14f88dd
committed
Fix fordotnet#69 - Invalid code generated when calling C# method with optional nullable args
Old codegen was improperly emitting default Nullable() for all nullable optional args that were not specified by the developer. This was correct when the default value was in fact "null" (i.e. Nullable()), but was incorrect when default value contains a real value (i.e. Nullable(42)). This change now detects when default value is a System.Nullable, and emits proper call to Nullable(xyz) constructor when required. This change is based on suggestion form Vlad in email a while back.Also noticed (from comment in the code) that VB allows byref optional args. Upon investigation, these were also being handled incorrectly, so I refactored a bit in order to handle those. (changeset 1280456)1 parent9179d77 commit14f88dd
File tree
9 files changed
+145
-23
lines changed- src/fsharp
- tests/fsharpqa/Source
- Conformance/DeclarationElements/MemberDefinitions/OptionalArguments
9 files changed
+145
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
724 | 729 | | |
725 | 730 | | |
726 | 731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
| 986 | + | |
986 | 987 | | |
987 | 988 | | |
988 | 989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8934 | 8934 | | |
8935 | 8935 | | |
8936 | 8936 | | |
8937 | | - | |
| 8937 | + | |
| 8938 | + | |
8938 | 8939 | | |
8939 | 8940 | | |
8940 | | - | |
| 8941 | + | |
8941 | 8942 | | |
8942 | | - | |
| 8943 | + | |
8943 | 8944 | | |
8944 | | - | |
| 8945 | + | |
| 8946 | + | |
| 8947 | + | |
| 8948 | + | |
| 8949 | + | |
| 8950 | + | |
| 8951 | + | |
| 8952 | + | |
| 8953 | + | |
| 8954 | + | |
8945 | 8955 | | |
8946 | 8956 | | |
8947 | 8957 | | |
8948 | 8958 | | |
8949 | 8959 | | |
8950 | 8960 | | |
8951 | | - | |
| 8961 | + | |
8952 | 8962 | | |
8953 | 8963 | | |
8954 | 8964 | | |
8955 | 8965 | | |
8956 | 8966 | | |
8957 | 8967 | | |
8958 | 8968 | | |
8959 | | - | |
| 8969 | + | |
8960 | 8970 | | |
8961 | 8971 | | |
8962 | 8972 | | |
8963 | | - | |
| 8973 | + | |
8964 | 8974 | | |
8965 | | - | |
8966 | | - | |
| 8975 | + | |
8967 | 8976 | | |
8968 | 8977 | | |
8969 | 8978 | | |
| |||
Lines changed: 40 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
12 | 48 | | |
13 | 49 | | |
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
6 | | - | |
7 | | - | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | | - | |
11 | | - | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | | - | |
19 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
20 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
21 | 37 | | |
22 | 38 | | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
145 | 152 | | |
146 | 153 | | |
147 | 154 | | |
| |||
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| 167 | + | |
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
| |||
726 | 734 | | |
727 | 735 | | |
728 | 736 | | |
| 737 | + | |
729 | 738 | | |
730 | 739 | | |
731 | 740 | | |
| |||
0 commit comments
Comments
(0)