Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2020-08-14 06:50:37 +0000
committerManoj Palat2020-08-14 06:50:37 +0000
commit7a1b357d9a108bbb81939ab1fab7ec689a126c9f (patch)
treead546abf9114ca5d6da377f6b8a8c68f215c9e9b /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler
parent2718f4861eb3702ce5f77ac30c337e89b1d86efa (diff)
parente5e0eecd92d4e497573f4df8043c4ac92e394ad1 (diff)
downloadeclipse.jdt.core-7a1b357d9a108bbb81939ab1fab7ec689a126c9f.tar.gz
eclipse.jdt.core-7a1b357d9a108bbb81939ab1fab7ec689a126c9f.tar.xz
eclipse.jdt.core-7a1b357d9a108bbb81939ab1fab7ec689a126c9f.zip
Merge branch 'master' into BETA_JAVA15Y20200814-0650Y20200814-0630
# Conflicts: # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java Change-Id: I5831b25dfd4bbeedd8ab04576daf6c0f219a6dc6
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler')
-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