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

NPE for super in anon. inner method within static method #871

Closed
eric-milles opened this issue Apr 11, 2019 · 0 comments
Closed

NPE for super in anon. inner method within static method #871

eric-milles opened this issue Apr 11, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

Consider the following:

static void meth() {
  new LinkedList() {
    @Override
    Object get(int i) {
      super.get(i)
    }
  }
}

Variable expression "super" is running into type inference error:

java.lang.NullPointerException
	at org.eclipse.jdt.groovy.search.VariableScope.lookupName(VariableScope.java:538)
	at org.eclipse.jdt.groovy.search.AbstractSimplifiedTypeLookup.getDeclaredVariable(AbstractSimplifiedTypeLookup.java:79)
	at org.eclipse.jdt.groovy.search.AbstractSimplifiedTypeLookup.lookupType(AbstractSimplifiedTypeLookup.java:122)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.lookupExpressionType(TypeInferencingVisitorWithRequestor.java:2353)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.handleSimpleExpression(TypeInferencingVisitorWithRequestor.java:1801)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitVariableExpression(TypeInferencingVisitorWithRequestor.java:1699)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant