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

fix: template matching ignores casts #3028

Merged
merged 6 commits into from
Feb 19, 2020
Merged

Conversation

Egor18
Copy link
Contributor

@Egor18 Egor18 commented Jun 20, 2019

Fix #3026.
I'm not so familiar with template matching in Spoon yet, but it looks like a bug to me.
I think matcher f(_x_.S()); should match f(new X()) as well as (Y) f(new X()), isn't it?

@Egor18 Egor18 changed the title bug: Demonstrate #3026 test: Demonstrate #3026 Jun 20, 2019
@monperrus
Copy link
Collaborator

Thanks a lot Egor for the bug reproduction.

Pavel @pvojtechovsky, we hope you're doing well. Any chance to have a look at this bug?

@Egor18 Egor18 changed the title test: Demonstrate #3026 fix: Fix #3026 Feb 14, 2020
@Egor18
Copy link
Contributor Author

Egor18 commented Feb 14, 2020

I added a possible fix.
This is probably a bit arguable solution because we skip casts during template matching now, but on the other hand we already do that with comments and some other stuff.

@monperrus
Copy link
Collaborator

Thanks Egor, I like this solution. We just need to document it. Could you add the explanation in the corresponding Markdown file?

@monperrus
Copy link
Collaborator

added documentation, will merge after CI.

@monperrus monperrus changed the title fix: Fix #3026 fix: template matching ignores casts Feb 19, 2020
@monperrus monperrus merged commit ed39577 into INRIA:master Feb 19, 2020
@monperrus
Copy link
Collaborator

thanks @Egor18

@monperrus monperrus mentioned this pull request Mar 20, 2020
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.

Matcher not working in case of cast
2 participants