summaryrefslogtreecommitdiffstats
path: root/subprojects/language
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/language')
-rw-r--r--subprojects/language/src/main/java/tools/refinery/language/scoping/ProblemScopeProvider.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/subprojects/language/src/main/java/tools/refinery/language/scoping/ProblemScopeProvider.java b/subprojects/language/src/main/java/tools/refinery/language/scoping/ProblemScopeProvider.java
index cf099aba..a4437ba6 100644
--- a/subprojects/language/src/main/java/tools/refinery/language/scoping/ProblemScopeProvider.java
+++ b/subprojects/language/src/main/java/tools/refinery/language/scoping/ProblemScopeProvider.java
@@ -44,7 +44,7 @@ public class ProblemScopeProvider extends AbstractProblemScopeProvider {
44 return getVariableScope(context, scope); 44 return getVariableScope(context, scope);
45 } 45 }
46 if (reference == ProblemPackage.Literals.REFERENCE_DECLARATION__OPPOSITE) { 46 if (reference == ProblemPackage.Literals.REFERENCE_DECLARATION__OPPOSITE) {
47 return getOppositeScope(context, scope); 47 return getOppositeScope(context);
48 } 48 }
49 return scope; 49 return scope;
50 } 50 }
@@ -96,16 +96,19 @@ public class ProblemScopeProvider extends AbstractProblemScopeProvider {
96 } 96 }
97 } 97 }
98 98
99 protected IScope getOppositeScope(EObject context, IScope delegateScope) { 99 protected IScope getOppositeScope(EObject context) {
100 var referenceDeclaration = EcoreUtil2.getContainerOfType(context, ReferenceDeclaration.class); 100 var referenceDeclaration = EcoreUtil2.getContainerOfType(context, ReferenceDeclaration.class);
101 if (referenceDeclaration == null) { 101 if (referenceDeclaration == null) {
102 return delegateScope; 102 return IScope.NULLSCOPE;
103 } 103 }
104 var relation = referenceDeclaration.getReferenceType(); 104 var relation = referenceDeclaration.getReferenceType();
105 if (!(relation instanceof ClassDeclaration classDeclaration)) { 105 if (!(relation instanceof ClassDeclaration classDeclaration)) {
106 return delegateScope; 106 return IScope.NULLSCOPE;
107 } 107 }
108 var referenceDeclarations = desugarer.getAllReferenceDeclarations(classDeclaration); 108 var referenceDeclarations = classDeclaration.getFeatureDeclarations()
109 return Scopes.scopeFor(referenceDeclarations, delegateScope); 109 .stream()
110 .filter(ReferenceDeclaration.class::isInstance)
111 .toList();
112 return Scopes.scopeFor(referenceDeclarations);
110 } 113 }
111} 114}