Community
Participate
Working Groups
Will try to find a minimal repro for this one. However, the problem is obvious: You shall not directly call XAbstractFeatureCall#getFeature in the type provider. java.lang.AssertionError: there is already another assumption about the given proxy. Please make sure that you don't use AbstractFeatureCall#getFeature in the type inference orin your scoping implementation but AbstractTypeProvider#getFeature instead. at org.eclipse.xtext.xbase.resource.XbaseResource.assumeLinked(XbaseResource.java:130) at org.eclipse.xtext.xbase.resource.LinkingAssumptions.assumeLinkedAndRun(LinkingAssumptions.java:86) at org.eclipse.xtext.xbase.linking.FeatureCallChecker.doCheck(FeatureCallChecker.java:240) at org.eclipse.xtext.xbase.linking.FeatureCallChecker.checkTypesWithoutGenerics(FeatureCallChecker.java:213) at org.eclipse.xtext.xbase.linking.BestMatchingJvmFeatureScope.getBestMatch(BestMatchingJvmFeatureScope.java:137) at org.eclipse.xtext.xbase.linking.BestMatchingJvmFeatureScope.getBestMatch(BestMatchingJvmFeatureScope.java:122) at org.eclipse.xtext.xbase.linking.BestMatchingJvmFeatureScope.getSingleElement(BestMatchingJvmFeatureScope.java:78) at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:121) at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175) at org.eclipse.xtext.xbase.resource.XbaseResource.access$0(XbaseResource.java:1) at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:227) at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:1) at org.eclipse.xtext.util.OnChangeEvictingCache.execWithoutCacheClear(OnChangeEvictingCache.java:121) at org.eclipse.xtext.xbase.resource.XbaseResource.getEObject(XbaseResource.java:225) at org.eclipse.xtext.xtend2.resource.Xtend2Resource.getEObject(Xtend2Resource.java:88) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:219) at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:203) at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:263) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1483) at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImpl.getFeature(XAbstractFeatureCallImpl.java:161) at org.eclipse.xtext.xbase.typing.XbaseTypeProvider.findTypeGuardedXCasePartContainer(XbaseTypeProvider.java:1009)
Pushed to master.
FWIW this problem seems to occur for instance when combining a switch expression with a contained closure calling a static method. E.g. def foo(EObject context) { switch (context) { EClass: context.EAllReferences.map(r|EObjectDescription::create('foo', r)) } } A workaround is to rewrite the switch using dispatch methods: def dispatch foo(EClass context) { context.EAllReferences.map(r|EObjectDescription::create('foo', r)) }
Closing all bugs that were set to RESOLVED before Neon.0