@@ -25,6 +25,8 @@ public struct MyStruct
25
25
}
26
26
public interface IMyInterface
27
27
{
28
+ int MyMethod();
29
+ long MyProperty { get; }
28
30
}
29
31
}
30
32
""" ,
@@ -33,6 +35,8 @@ namespace MyNamespace
33
35
{
34
36
+ public interface IMyInterface
35
37
+ {
38
+ + int MyMethod();
39
+ + long MyProperty { get; }
36
40
+ }
37
41
}
38
42
""" ) ;
@@ -44,6 +48,8 @@ namespace MyNamespace
44
48
{
45
49
public interface IMyBeforeInterface
46
50
{
51
+ int MyMethod();
52
+ long MyProperty { get; }
47
53
}
48
54
}
49
55
""" ,
@@ -52,6 +58,8 @@ namespace MyNamespace
52
58
{
53
59
public interface IMyAfterInterface
54
60
{
61
+ int MyMethod();
62
+ long MyProperty { get; }
55
63
}
56
64
}
57
65
""" ,
@@ -60,9 +68,13 @@ namespace MyNamespace
60
68
{
61
69
- public interface IMyBeforeInterface
62
70
- {
71
+ - int MyMethod();
72
+ - long MyProperty { get; }
63
73
- }
64
74
+ public interface IMyAfterInterface
65
75
+ {
76
+ + int MyMethod();
77
+ + long MyProperty { get; }
66
78
+ }
67
79
}
68
80
""" ) ;
@@ -77,6 +89,8 @@ public struct MyStruct
77
89
}
78
90
public interface IMyInterface
79
91
{
92
+ int MyMethod();
93
+ long MyProperty { get; }
80
94
}
81
95
}
82
96
""" ,
@@ -93,9 +107,46 @@ namespace MyNamespace
93
107
{
94
108
- public interface IMyInterface
95
109
- {
110
+ + int MyMethod();
111
+ + long MyProperty { get; }
96
112
- }
97
113
}
98
114
""" ) ;
99
115
116
+ [ Fact ( Skip = "The resulting inheritance shows more than expected but not wrong, and does not show the nullability constraing" ) ]
117
+ // Shows: public interface IMyInterface<TKey, TValue> : System.Collections.Generic.IDictionary<TKey, TValue>, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable, System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>
118
+ public Task InterfaceAddWithTypeConstraints ( ) => RunTestAsync (
119
+ beforeCode : """
120
+ using System.Collections.Generic;
121
+ namespace MyNamespace
122
+ {
123
+ public struct MyStruct
124
+ {
125
+ }
126
+ }
127
+ """ ,
128
+ afterCode : """
129
+ using System.Collections.Generic;
130
+ namespace MyNamespace
131
+ {
132
+ public struct MyStruct
133
+ {
134
+ }
135
+ public interface IMyInterface<TKey, TValue> : IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue> where TKey : notnull
136
+ {
137
+ bool ContainsValue(TValue value);
138
+ }
139
+ }
140
+ """ ,
141
+ expectedCode : """
142
+ namespace MyNamespace
143
+ {
144
+ + public interface IMyInterface<TKey, TValue> : System.Collections.Generic.IDictionary<TKey, TValue>, System.Collections.Generic.IReadOnlyDictionary<TKey, TValue> where TKey : notnull
145
+ + {
146
+ + bool ContainsValue(TValue value);
147
+ + }
148
+ }
149
+ """ ) ;
150
+
100
151
#endregion
101
152
}
0 commit comments