-
-
Notifications
You must be signed in to change notification settings - Fork 244
Issue215 #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue215 #228
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1531,11 +1531,13 @@ Expression ParseMemberAccess(Type type, Expression instance) | |
| return Expression.Dynamic(new DynamicGetMemberBinder(id), type, instance); | ||
| } | ||
| #endif | ||
|
|
||
| MethodInfo indexerMethod = instance.Type.GetMethod("get_Item", new[] { typeof(string) }); | ||
| if (indexerMethod != null) | ||
| if (!_parsingConfig.DisableMemberAccessToIndexAccesorDowncast) | ||
| { | ||
| return Expression.Call(instance, indexerMethod, Expression.Constant(id)); | ||
| MethodInfo indexerMethod = instance.Type.GetMethod("get_Item", new[] {typeof(string)}); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing some spaces here, did you do a format-file? |
||
| if (indexerMethod != null) | ||
| { | ||
| return Expression.Call(instance, indexerMethod, Expression.Constant(id)); | ||
| } | ||
| } | ||
|
|
||
| if (_textParser.CurrentToken.Id == TokenId.Lambda && _it.Type == type) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -103,5 +103,12 @@ public IExpressionPromoter ExpressionPromoter | |||||
| /// Renames the (Typed)ParameterExpression empty Name to a the correct supplied name from `it`. Default value is false. | ||||||
| /// </summary> | ||||||
| public bool RenameParameterExpression { get; set; } = false; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// By default when a member is not found in a type and the type has a string bassed index accessor it will be parsed as an index accesor. Use | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. based
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double 's' |
||||||
| /// this flag to disable this behaviour and have parsing fail when parsing an expression | ||||||
| /// where a member access on a non existing member happens | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| /// </summary> | ||||||
| public bool DisableMemberAccessToIndexAccesorDowncast { get; set; } = false; | ||||||
| } | ||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.