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

A class can be declared in a lambda expression. #513

Merged
merged 2 commits into from
Feb 3, 2016
Merged

A class can be declared in a lambda expression. #513

merged 2 commits into from
Feb 3, 2016

Conversation

GerardPaligot
Copy link
Contributor

Closes #507

return (CtType<T>) elements.get(0).getAnonymousClass();
}
return null;
return getFactory().Type().get(getQualifiedName());
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

@monperrus
Copy link
Collaborator

Indeed:

 Object o = new Object(){
     @Override
     public String toString() {return "foo";};
 };

 System.out.println(o.getClass().getSimpleName());
 System.out.println(o.getClass().getCanonicalName());
 System.out.println(o.getClass().getName());
 System.out.println(o.getClass().isAnonymousClass());

returns


null
Foo$1
true
 class Titi {}
 System.out.println(Titi.class.getSimpleName());
 System.out.println(Titi.class.getCanonicalName());
 System.out.println(Titi.class.getName());
 System.out.println(Titi.class.isAnonymousClass());

returns

Titi
null
Foo$1Titi
false

@@ -60,6 +60,11 @@
boolean isAnonymous();

/**
* Return {@code true} if the referenced type is declared in an executable.
*/
boolean isLocal();
Copy link
Collaborator

Choose a reason for hiding this comment

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

not directly specified in any assert

@GerardPaligot
Copy link
Contributor Author

@monperrus PR ok.

@monperrus monperrus merged commit ff01982 into INRIA:stable Feb 3, 2016
@GerardPaligot GerardPaligot deleted the fix_lambda_targeted branch February 3, 2016 14:48
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.

2 participants