Skip to content
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

Type from registered type has higher preference than input parameter expression with same name #727

Closed
abbasc52 opened this issue Aug 2, 2023 · 0 comments · Fixed by #728
Labels

Comments

@abbasc52
Copy link
Contributor

abbasc52 commented Aug 2, 2023

1. Description

When registering a Type with [DynamicLinqType] or with adding it in custom type provider, it gains precedence over passed input parameters. Even if the case is different from Type, type get higher preference.

Ideally input parameters should have highest priority.

2. Exception

Exception message:Unhandled exception. '.' or '(' or string literal expected (at index 3)
Stack trace:   at System.Linq.Dynamic.Core.Tokenizer.TextParser.ValidateToken(TokenId tokenId, String errorMessage) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Tokenizer\TextParser.cs:line 451
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseTypeAccess(Type type, Boolean getNext) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 1658
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIdentifier() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 941
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimaryStart() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 817
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 785
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 780
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMultiplicative() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 725

3. Fiddle or Project

If you are able,

Provide a Fiddle that reproduce the issue: https://dotnetfiddle.net/6nbGZ6

4. Any further technical details

Add any relevant detail that can help us.

@abbasc52 abbasc52 changed the title Type from registered registered type has higher preference than input parameter expression Type from registered type has higher preference than input parameter expression Aug 2, 2023
@abbasc52 abbasc52 changed the title Type from registered type has higher preference than input parameter expression Type from registered type has higher preference than input parameter expression with same name Aug 2, 2023
@StefH StefH added the feature label Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants