Open Boereck opened 5 years ago
interestingly this affects outline / override indicator but not compile itself. @szarnekow any idea?
Here is a slightly more complex example that also makes the compiler fail:
class Hmpf<T> {
def void errr() {
new Wham<T> {
var Iterable<T> bla = null
def void boom() {
bla = null
}
}
}
}
class Wham<T> extends Hmpf<T> {}
Interestingly, the build does not have a problem as long as field bla
is not accessed. But as soon as it is, the compilation is failing.
The maven build fails with the following message:
[ERROR] resolution of uriFragment '|2' failed.
java.lang.IllegalArgumentException: argument is not valid in current context
at org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference.addTypeArgument(ParameterizedTypeReference.java:798)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.enhanceParameterizedTypeReference(TypeParameterSubstitutor.java:142)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:134)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:116)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:36)
at org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference.accept(ParameterizedTypeReference.java:857)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.substitute(TypeParameterSubstitutor.java:224)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate.computeFixedArityArgumentType(AbstractLinkingCandidate.java:577)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate.computeArgumentType(AbstractLinkingCandidate.java:443)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate.computeArgumentTypes(AbstractLinkingCandidate.java:430)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate.preApply(AbstractLinkingCandidate.java:378)
at org.eclipse.xtext.xbase.typesystem.internal.FeatureLinkingCandidate.preApply(FeatureLinkingCandidate.java:896)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate.applyToComputationState(AbstractLinkingCandidate.java:286)
at org.eclipse.xtext.xbase.typesystem.computation.XbaseTypeComputer._computeTypes(XbaseTypeComputer.java:1221)
at org.eclipse.xtext.xbase.typesystem.computation.XbaseTypeComputer.computeTypes(XbaseTypeComputer.java:110)
at org.eclipse.xtext.xbase.annotations.typesystem.XbaseWithAnnotationsTypeComputer.computeTypes(XbaseWithAnnotationsTypeComputer.java:46)
at org.eclipse.xtend.core.typesystem.XtendTypeComputer.computeTypes(XtendTypeComputer.java:64)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState.doComputeTypes(AbstractTypeComputationState.java:121)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState.computeTypes(AbstractTypeComputationState.java:109)
at org.eclipse.xtext.xbase.typesystem.computation.XbaseTypeComputer._computeTypes(XbaseTypeComputer.java:491)
at org.eclipse.xtext.xbase.typesystem.computation.XbaseTypeComputer.computeTypes(XbaseTypeComputer.java:118)
at org.eclipse.xtext.xbase.annotations.typesystem.XbaseWithAnnotationsTypeComputer.computeTypes(XbaseWithAnnotationsTypeComputer.java:46)
at org.eclipse.xtend.core.typesystem.XtendTypeComputer.computeTypes(XtendTypeComputer.java:64)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState.doComputeTypes(AbstractTypeComputationState.java:121)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState.computeTypes(AbstractTypeComputationState.java:109)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractRootTypeComputationState.computeTypes(AbstractRootTypeComputationState.java:32)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver._computeTypes(LogicalContainerAwareReentrantTypeResolver.java:827)
at org.eclipse.xtend.core.typesystem.XtendReentrantTypeResolver._computeTypes(XtendReentrantTypeResolver.java:612)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeTypes(LogicalContainerAwareReentrantTypeResolver.java:711)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeMemberTypes(LogicalContainerAwareReentrantTypeResolver.java:897)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver._computeTypes(LogicalContainerAwareReentrantTypeResolver.java:886)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeTypes(LogicalContainerAwareReentrantTypeResolver.java:705)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeLocalTypes(LogicalContainerAwareReentrantTypeResolver.java:796)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver._computeTypes(LogicalContainerAwareReentrantTypeResolver.java:832)
at org.eclipse.xtend.core.typesystem.XtendReentrantTypeResolver._computeTypes(XtendReentrantTypeResolver.java:612)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeTypes(LogicalContainerAwareReentrantTypeResolver.java:711)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeMemberTypes(LogicalContainerAwareReentrantTypeResolver.java:897)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver._computeTypes(LogicalContainerAwareReentrantTypeResolver.java:886)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeTypes(LogicalContainerAwareReentrantTypeResolver.java:705)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeTypes(LogicalContainerAwareReentrantTypeResolver.java:697)
at org.eclipse.xtend.core.typesystem.XtendReentrantTypeResolver.computeTypes(XtendReentrantTypeResolver.java:382)
at org.eclipse.xtext.xbase.typesystem.internal.DefaultReentrantTypeResolver.resolve(DefaultReentrantTypeResolver.java:164)
at org.eclipse.xtext.xbase.typesystem.internal.DefaultReentrantTypeResolver.reentrantResolve(DefaultReentrantTypeResolver.java:139)
at org.eclipse.xtext.xbase.typesystem.internal.CompoundReentrantTypeResolver.reentrantResolve(CompoundReentrantTypeResolver.java:79)
at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver$LazyResolvedTypes.resolveTypes(CachingBatchTypeResolver.java:80)
at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver$2.process(CachingBatchTypeResolver.java:57)
at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver$2.process(CachingBatchTypeResolver.java:53)
at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:37)
at org.eclipse.xtext.util.OnChangeEvictingCache.execWithoutCacheClear(OnChangeEvictingCache.java:128)
at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver.doResolveTypes(CachingBatchTypeResolver.java:53)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractBatchTypeResolver.resolveTypes(AbstractBatchTypeResolver.java:69)
at org.eclipse.xtext.xbase.resource.BatchLinkingService.resolveBatched(BatchLinkingService.java:60)
at org.eclipse.xtext.xbase.resource.BatchLinkingService.resolveBatched(BatchLinkingService.java:41)
at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getEObject(BatchLinkableResource.java:117)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:199)
at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:259)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1477)
at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImplCustom.getFeature(XAbstractFeatureCallImplCustom.java:48)
at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImpl.eGet(XAbstractFeatureCallImpl.java:490)
at org.eclipse.xtext.xbase.impl.XAssignmentImpl.eGet(XAssignmentImpl.java:300)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:439)
at org.eclipse.emf.ecore.util.EcoreUtil.resolveCrossReferences(EcoreUtil.java:304)
at org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:298)
at org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:283)
at org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler.compile(XtendBatchCompiler.java:513)
at org.eclipse.xtend.maven.AbstractXtendCompilerMojo.compile(AbstractXtendCompilerMojo.java:163)
at org.eclipse.xtend.maven.XtendCompile.internalExecute(XtendCompile.java:60)
at org.eclipse.xtend.maven.AbstractXtendMojo.execute(AbstractXtendMojo.java:40)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
ERROR:
1: IllegalArgumentException: argument is not valid in current context (see logs for details)
[ERROR]
ERROR: Hmpf.xtend - ...\Hmpf.xtend
10: The method bla(Object) is undefined
Hi,
I've extracted a minimal example of Xtend code that makes the Xtend IDE (version 2.18) crash with the following message:
Here is the code making the IDE crash:
It looks like a case of infinite recursion, here is an extract of the stack trace: