当我尝试运行下面的函数时,我在将函数结果作为参数传递给另一个函数时遇到问题;
lrel[loc location,str action_type]temp = getScripts("ptl/src/reverseengineering/examples/testbed/workflows");
result = generatePTLAST(temp);
我收到一个无赖的内部错误;
io.usethesource.vallang.exceptions.RedeclaredConstructorException: Constructor quotedIdentifier overloaded with comparable argument types: tuple[str quotedId] and tuple[str name]
(internal error)
at $shell$(|main://$shell$|)
io.usethesource.vallang.exceptions.RedeclaredConstructorException: Constructor quotedIdentifier overloaded with comparable argument types: tuple[str quotedId] and tuple[str name]
at io.usethesource.vallang.type.TypeStore.checkOverloading(TypeStore.java:393)
at io.usethesource.vallang.type.TypeStore.declareConstructor(TypeStore.java:337)
at io.usethesource.vallang.type.TypeFactory.constructorFromTuple(TypeFactory.java:608)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.ListType$Info.fromSymbol(ListType.java:53)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.ListType$Info.fromSymbol(ListType.java:53)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbols(TypeFactory.java:1135)
at io.usethesource.vallang.type.ConstructorType$Info.fromProduction(ConstructorType.java:118)
at io.usethesource.vallang.type.AbstractDataType$Info.fromSymbol(AbstractDataType.java:126)
at io.usethesource.vallang.type.TypeFactory$TypeValues.fromSymbol(TypeFactory.java:1111)
at io.usethesource.vallang.type.TypeFactory.fromSymbol(TypeFactory.java:732)
at org.rascalmpl.types.TypeReifier.symbolToType(TypeReifier.java:206)
at org.rascalmpl.values.RascalValueFactory.reifiedType(RascalValueFactory.java:389)
at org.rascalmpl.types.TypeReifier.typeToValue(TypeReifier.java:63)
at org.rascalmpl.semantics.dynamic.Expression$ReifyType.interpret(Expression.java:2376)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:502)
at org.rascalmpl.semantics.dynamic.Declarator$Default.interpret(Declarator.java:52)
at org.rascalmpl.semantics.dynamic.LocalVariableDeclaration$Default.interpret(LocalVariableDeclaration.java:36)
at org.rascalmpl.semantics.dynamic.Statement$VariableDeclaration.interpret(Statement.java:1003)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
at org.rascalmpl.interpreter.result.AbstractPatternDispatchedFunction.call(AbstractPatternDispatchedFunction.java:186)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:409)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:369)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:540)
at org.rascalmpl.semantics.dynamic.ListComprehensionWriter.append(ListComprehensionWriter.java:38)
at org.rascalmpl.semantics.dynamic.Comprehension.evalComprehension(Comprehension.java:95)
at org.rascalmpl.semantics.dynamic.Comprehension$List.interpret(Comprehension.java:39)
at org.rascalmpl.semantics.dynamic.Expression$Comprehension.interpret(Expression.java:681)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:502)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
at org.rascalmpl.interpreter.utils.Cases.matchAndEval(Cases.java:443)
at org.rascalmpl.interpreter.utils.Cases$DefaultBlock.matchAndEval(Cases.java:271)
at org.rascalmpl.interpreter.utils.Cases$NodeCaseBlock.tryCases(Cases.java:406)
at org.rascalmpl.interpreter.utils.Cases$NodeCaseBlock.matchAndEval(Cases.java:391)
at org.rascalmpl.semantics.dynamic.Statement$Switch.interpret(Statement.java:898)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:409)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:369)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:540)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:205)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:540)
at org.rascalmpl.semantics.dynamic.Expression$Tuple.interpret(Expression.java:2776)
at org.rascalmpl.semantics.dynamic.ListComprehensionWriter.append(ListComprehensionWriter.java:38)
at org.rascalmpl.semantics.dynamic.Comprehension.evalComprehension(Comprehension.java:95)
at org.rascalmpl.semantics.dynamic.Comprehension$List.interpret(Comprehension.java:39)
at org.rascalmpl.semantics.dynamic.Expression$Comprehension.interpret(Expression.java:681)
at org.rascalmpl.semantics.dynamic.Declarator$Default.interpret(Declarator.java:52)
at org.rascalmpl.semantics.dynamic.LocalVariableDeclaration$Default.interpret(LocalVariableDeclaration.java:36)
at org.rascalmpl.semantics.dynamic.Statement$VariableDeclaration.interpret(Statement.java:1003)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:540)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:205)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:294)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:540)
at org.rascalmpl.semantics.dynamic.Command$Expression.interpret(Command.java:61)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:1094)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:955)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:908)
at org.rascalmpl.repl.RascalInterpreterREPL.evalStatement(RascalInterpreterREPL.java:132)
at org.rascalmpl.vscode.lsp.terminal.LSPTerminalREPL$1.evalStatement(LSPTerminalREPL.java:136)
at org.rascalmpl.repl.BaseRascalREPL.handleInput(BaseRascalREPL.java:106)
at org.rascalmpl.vscode.lsp.terminal.LSPTerminalREPL$1.handleInput(LSPTerminalREPL.java:238)
at org.rascalmpl.repl.BaseREPL.handleInput(BaseREPL.java:180)
at org.rascalmpl.repl.BaseREPL.run(BaseREPL.java:347)
at org.rascalmpl.vscode.lsp.terminal.LSPTerminalREPL.main(LSPTerminalREPL.java:320)
但是当我手写
getScripts
函数的输出并将该硬编码输出作为参数传递时,generatePTLAST
起作用了,为什么会这样呢?我认为这是 Rascal 的问题,但我可能错了。
错误消息令人困惑,因为内部错误未被捕获并作为用户指示的消息重新抛出。这意味着 rascal 无法区分两个构造函数,需要帮助消除构造函数定义的歧义。
代码手动工作可能是因为在终端 repl 的范围内,两个有问题的构造函数同时不可见。
在函数所在的模块作用域中,存在两个名为带引号标识符的数据构造函数的定义,它们不通过参数的类型进行区分。
正如 @markhills 所写,这可能是由于读取了使用不同名称的数据类型的先前版本写入的数据的二进制版本引起的。它也可能是由来自两个不同导入的两个不同定义引起的。等等
要修复,请将字段名称bank更改为原始名称。读取数据。将名称改回新名称,重新写入数据。或者,删除其中一个重复项,或使两者的名称相同。