Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
index 529574f0d0..90f7a9beef 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
@@ -77,9 +77,14 @@ public SyntheticArgumentBinding addSyntheticArgument(LocalVariableBinding actual
/* Add a new synthetic argument for <enclosingType>.
* Answer the new argument or the existing argument if one already existed.
+* Do not add if this is static (eg. nested records)
*/
public SyntheticArgumentBinding addSyntheticArgument(ReferenceBinding targetEnclosingType) {
if (!isPrototype()) throw new IllegalStateException();
+ if (isStatic()) {
+ assert this.isRecord();// a local record is implicitly static; no other local type can be static
+ return null;
+ }
SyntheticArgumentBinding synthLocal = null;
if (this.enclosingInstances == null) {
synthLocal = new SyntheticArgumentBinding(targetEnclosingType);

Back to the top