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: fix incorrect parent for type reference of a CtParameter #3696

Merged
merged 9 commits into from
Nov 24, 2020

Conversation

andrewbwogi
Copy link
Contributor

@andrewbwogi andrewbwogi commented Nov 15, 2020

close #3671

@monperrus
Copy link
Collaborator

Thanks @andrewbwogi for the work on this fix. Could you have a look at the CI failures?

@andrewbwogi andrewbwogi changed the title fix: incorrect parent to type reference of a CtParameter, close #3671 WIP: fix incorrect parent to type reference of a CtParameter, close #3671 Nov 18, 2020
Comment on lines +82 to +86
if (parameter.getType() == null) {
ref.setType(parameter.getType());
} else {
ref.setType(parameter.getType().clone());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This solution works but it hides an implicit difference between ordinary parameters and parameters in lambda expressions. Is it better to create a CtLambdaParameter class?

@monperrus
Copy link
Collaborator

Is it better to create a CtLambdaParameter class?

It would probably be overkill.

Do you mean that we don't have a fully backward compatible fix for now?

@andrewbwogi
Copy link
Contributor Author

The fix only expands information in the AST so it should be backwards compatible.

@andrewbwogi andrewbwogi changed the title WIP: fix incorrect parent to type reference of a CtParameter, close #3671 Fix: incorrect parent to type reference of a CtParameter, close #3671 Nov 23, 2020
@monperrus
Copy link
Collaborator

Great, thanks @andrewbwogi !

In Spoon, we always have a one line contract in natural language for each test:

// contract: after adding an element in a list, the size is incremented

Could you add the contract?

Then we merge!

@monperrus monperrus changed the title Fix: incorrect parent to type reference of a CtParameter, close #3671 fix: fix incorrect parent for type reference of a CtParameter Nov 24, 2020
@monperrus monperrus merged commit e436d36 into INRIA:master Nov 24, 2020
@monperrus
Copy link
Collaborator

Thanks @andrewbwogi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants