Skip to content

No longer try to parse a generic type if there's no possible candidates#315

Merged
metoule merged 4 commits intodynamicexpresso:masterfrom
metoule:fix_314
Aug 19, 2024
Merged

No longer try to parse a generic type if there's no possible candidates#315
metoule merged 4 commits intodynamicexpresso:masterfrom
metoule:fix_314

Conversation

@metoule
Copy link
Copy Markdown
Contributor

@metoule metoule commented Aug 17, 2024

With the current algorithm that parses known types, we first try to parse the type argument list before checking if there's a matching generic type definition in the known types. This leads to an improper error message when trying to perform a less than comparison on a unknown identifier, because we try to parse the comparison as the type argument list 😅

var i = new Interpreter();
var x= i.Eval("b < 1"); // ParseException: '>' expected (at index 4). [misleading]

Fix #314

@metoule metoule requested a review from davideicardi as a code owner August 17, 2024 16:15
Copy link
Copy Markdown
Member

@davideicardi davideicardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@metoule metoule merged commit 80031cb into dynamicexpresso:master Aug 19, 2024
@metoule metoule deleted the fix_314 branch August 19, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading Parser error on '<' with missing Parameter

2 participants