File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ internal static partial class ObjectExtensions
98
98
99
99
if ( part . StartsWith ( '[' ) && part . EndsWith ( ']' ) )
100
100
{
101
- // Indexer: [index ] or [key ]
101
+ // Indexer: [int ] or [string ]
102
102
string indexer = part [ 1 ..^ 1 ] ;
103
103
if ( int . TryParse ( indexer , out int intIndex ) )
104
104
index = intIndex ;
@@ -123,8 +123,9 @@ internal static partial class ObjectExtensions
123
123
continue ;
124
124
}
125
125
126
- // Try default indexer property (e.g., this[string])
127
- pi = currentType ? . GetProperty ( "Item" ) ;
126
+ // Try to find a default indexer property "Item" (e.g., this[string]);
127
+ // Note that only single argument indexers of type int or string are currently support
128
+ pi = currentType ? . GetProperty ( "Item" , [ index . GetType ( ) ] ) ;
128
129
if ( pi != null )
129
130
{
130
131
current = pi . GetValue ( current , [ index ] ) ;
You can’t perform that action at this time.
0 commit comments