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 issue #3052 #3056

Merged
merged 1 commit into from
Jul 25, 2019
Merged

fix: Fix issue #3052 #3056

merged 1 commit into from
Jul 25, 2019

Conversation

Egor18
Copy link
Contributor

@Egor18 Egor18 commented Jul 23, 2019

Fix #3052.
Here is why this bug is happening:
Eclipse jdt tells us that the binding of the listener variable inside the lambda is null in noclasspath mode,
so we run createVariableAccessNoClasspath(), it calls getVariableDeclaration(), which uses classFactory.create() for inner classes improperly. This leads to the creation of a new top-level class Failing (with unknown position), so references get messed up and we get this new class with no position instead of the original Failing.

More specifically the problem was that the description of the classFactory.create() said that it can handle both . and $, but its implementation handles only $, so I added getNormalQualifiedName() and fixed context builder. By the way, it's not possible to handle them both in classFactory.create(), since . is used as a package separator and $ as an inner type separator and we need to distinguish between the two of them.

@monperrus
Copy link
Collaborator

That's great! thanks a lot @Egor18

@aveuiller would you make a try and confirm that it fixes your problem before we merge to master?

@aveuiller
Copy link
Contributor

I tried it out and the fix is working. Thanks for the quick reaction !

Do you know when you will to release a patch version with this fix?

@monperrus monperrus merged commit 49e395f into INRIA:master Jul 25, 2019
@monperrus
Copy link
Collaborator

Do you know when you will to release a patch version with this fix?

When #3057 is merged.

@monperrus
Copy link
Collaborator

Should be released now :-)

@aveuiller
Copy link
Contributor

I confirm, and it's working perfectly. Thanks!

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.

bug: Unknown source position when using lambda in inner class
3 participants