Repository navigation
Closed
Labels
Description
In LinkedList.wurst, when changing
function foldl<Q>(Q startValue, FoldClosure<T, Q> predicate) returns Q
to
function foldl<Q, T>(Q startValue, FoldClosure<T, Q> predicate) returns Q
de.peeeq.wurstscript.ast.CyclicDependencyError
at de.peeeq.wurstscript.ast.WShortParameterImpl.attrTyp(WShortParameterImpl.java:189)
at de.peeeq.wurstscript.attributes.Generics.lambda$inferTypeParametersUsingArguments$0(Generics.java:61)
at de.peeeq.wurstscript.types.WurstTypeDeferred.force(WurstTypeDeferred.java:63)
at de.peeeq.wurstscript.types.WurstTypeDeferred.isSubtypeOfIntern(WurstTypeDeferred.java:30)
at de.peeeq.wurstscript.types.WurstType.isSubtypeOf(WurstType.java:40)
at de.peeeq.wurstscript.types.WurstType.isSubtypeOf(WurstType.java:26)
at de.peeeq.wurstscript.types.WurstType.equalsType(WurstType.java:71)
at de.peeeq.wurstscript.attributes.Generics.inferTypeParameters(Generics.java:97)
at de.peeeq.wurstscript.attributes.Generics.inferTypeParameters(Generics.java:90)
at de.peeeq.wurstscript.attributes.Generics.inferTypeParameters(Generics.java:90)
at de.peeeq.wurstscript.attributes.Generics.inferTypeParameters(Generics.java:120)
at de.peeeq.wurstscript.attributes.Generics.inferTypeParametersUsingArguments(Generics.java:70)
at de.peeeq.wurstscript.attributes.Generics.getTypeParameterBindings(Generics.java:31)
at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTypeParameterBindings(ExprFunctionCallImpl.java:500)
at de.peeeq.wurstscript.attributes.AttrPossibleFunctionSignatures.calculate(AttrPossibleFunctionSignatures.java:27)
at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFunctionSignatures(ExprFunctionCallImpl.java:450)
at de.peeeq.wurstscript.attributes.AttrExprExpectedType.expectedType(AttrExprExpectedType.java:129)
at de.peeeq.wurstscript.attributes.AttrExprExpectedType.calculate(AttrExprExpectedType.java:29)
at de.peeeq.wurstscript.ast.ExprClosureImpl.attrExpectedTypRaw(ExprClosureImpl.java:261)
at de.peeeq.wurstscript.attributes.AttrExprExpectedType.normalizedType(AttrExprExpectedType.java:146)
at de.peeeq.wurstscript.ast.ExprClosureImpl.attrExpectedTyp(ExprClosureImpl.java:275)
at de.peeeq.wurstscript.attributes.AttrVarDefType.calculate(AttrVarDefType.java:44)
at de.peeeq.wurstscript.ast.WShortParameterImpl.attrTyp(WShortParameterImpl.java:186)
at de.peeeq.wurstscript.validation.controlflow.DataflowAnomalyAnalysis.checkIfVarsInitialized(DataflowAnomalyAnalysis.java:318)
at de.peeeq.wurstscript.validation.controlflow.DataflowAnomalyAnalysis.calculate(DataflowAnomalyAnalysis.java:248)
at de.peeeq.wurstscript.validation.controlflow.DataflowAnomalyAnalysis.calculate(DataflowAnomalyAnalysis.java:220)
at de.peeeq.wurstscript.validation.controlflow.ForwardExecution.checkStmt(ForwardExecution.java:52)
at de.peeeq.wurstscript.validation.controlflow.ForwardExecution.execute(ForwardExecution.java:31)
at de.peeeq.wurstscript.validation.controlflow.ForwardMethod.execute(ForwardMethod.java:41)
at de.peeeq.wurstscript.validation.WurstValidator.checkUninitializedVars(WurstValidator.java:1061)
at de.peeeq.wurstscript.validation.WurstValidator.check(WurstValidator.java:270)
at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:207)
at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:210)
at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:210)
at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:210)
at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:210)
at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:210)
at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:210)
at de.peeeq.wurstscript.validation.WurstValidator.validate(WurstValidator.java:55)
at de.peeeq.wurstscript.WurstChecker.checkProg(WurstChecker.java:46)
at de.peeeq.wurstio.WurstCompilerJassImpl.checkProg(WurstCompilerJassImpl.java:326)
at de.peeeq.wurstio.WurstCompilerJassImpl.checkProg(WurstCompilerJassImpl.java:314)
at de.peeeq.wurstio.languageserver.ModelManagerImpl.doTypeCheck(ModelManagerImpl.java:282)
at de.peeeq.wurstio.languageserver.ModelManagerImpl.buildProject(ModelManagerImpl.java:116)
at de.peeeq.wurstio.languageserver.LanguageWorker.doInit(LanguageWorker.java:208)
at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$getNextWorkItem$0(LanguageWorker.java:163)
at de.peeeq.wurstio.languageserver.LanguageWorker$Workitem.run(LanguageWorker.java:28)
at de.peeeq.wurstio.languageserver.LanguageWorker.run(LanguageWorker.java:145)
at java.lang.Thread.run(Unknown Source)
Mai 16, 2018 1:38:32 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: de.peeeq.wurstscript.ast.CyclicDependencyError
java.util.concurrent.CompletionException: de.peeeq.wurstscript.ast.CyclicDependencyError
at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
at java.util.concurrent.CompletableFuture.uniApply(Unknown Source)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
at de.peeeq.wurstio.languageserver.requests.UserRequest.handleException(UserRequest.java:40)
at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$handle$3(LanguageWorker.java:272)
at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
at de.peeeq.wurstio.languageserver.requests.UserRequest.run(UserRequest.java:34)
at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$getNextWorkItem$1(LanguageWorker.java:170)
at de.peeeq.wurstio.languageserver.LanguageWorker$Workitem.run(LanguageWorker.java:28)
at de.peeeq.wurstio.languageserver.LanguageWorker.run(LanguageWorker.java:145)
at java.lang.Thread.run(Unknown Source)
Caused by: de.peeeq.wurstscript.ast.CyclicDependencyError
at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFunctionSignatures(ExprFunctionCallImpl.java:453)
at de.peeeq.wurstscript.attributes.AttrFunctionSignature.calculate(AttrFunctionSignature.java:15)
at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrFunctionSignature(ExprFunctionCallImpl.java:464)
at de.peeeq.wurstscript.attributes.AttrExprType.calculate(AttrExprType.java:416)
at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTypRaw(ExprFunctionCallImpl.java:342)
at de.peeeq.wurstscript.attributes.AttrExprType.normalizedType(AttrExprType.java:510)
at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTyp(ExprFunctionCallImpl.java:314)
at de.peeeq.wurstscript.attributes.AttrVarDefType.defaultCase(AttrVarDefType.java:77)
at de.peeeq.wurstscript.attributes.AttrVarDefType.calculate(AttrVarDefType.java:24)
at de.peeeq.wurstscript.ast.LocalVarDefImpl.attrTyp(LocalVarDefImpl.java:300)
at de.peeeq.wurstscript.attributes.AttrExprType.calculate(AttrExprType.java:73)
at de.peeeq.wurstscript.ast.ExprVarAccessImpl.attrTypRaw(ExprVarAccessImpl.java:275)
at de.peeeq.wurstscript.attributes.AttrExprType.normalizedType(AttrExprType.java:510)
at de.peeeq.wurstscript.ast.ExprVarAccessImpl.attrTyp(ExprVarAccessImpl.java:247)
at de.peeeq.wurstscript.attributes.AttrFuncDef.calculate(AttrFuncDef.java:76)
at de.peeeq.wurstscript.ast.ExprMemberMethodDotImpl.attrFuncDef(ExprMemberMethodDotImpl.java:594)
at de.peeeq.wurstscript.attributes.AttrNameDef.tryGetNameDef(AttrNameDef.java:113)
at de.peeeq.wurstscript.ast.ExprMemberMethodDotImpl.tryGetNameDef(ExprMemberMethodDotImpl.java:479)
at de.peeeq.wurstio.languageserver.requests.GetUsages.execute(GetUsages.java:61)
at de.peeeq.wurstio.languageserver.requests.GetUsages.execute(GetUsages.java:18)
at de.peeeq.wurstio.languageserver.requests.UserRequest.run(UserRequest.java:31)
... 4 more
Activity
peq commentedon May 16, 2018
Frotty commentedon May 16, 2018
What call?

It isn't even called.
Simply modifying the code this way causes that exception.
I don't understand the workaround?
peq commentedon May 16, 2018
The error in the screenshot is something different: That is a valid error, because
r.elemhas typeT(the class type parameterT) andrunexpects aT(thefoldlfunction parameterT). You really should not shadow type parameter names to avoid this confusion -- I can add a warning for this.The cyclic dependency error can be worked around by adapting the calls to
foldl:I hope the bug should be fixed with the type refactoring I am doing currently.
test for #655
peq commentedon Jun 13, 2018
Fixed with #673
Type-checking refactor (WIP) (#673)