diff --git a/modules/nf-lang/src/main/java/nextflow/script/control/VariableScopeVisitor.java b/modules/nf-lang/src/main/java/nextflow/script/control/VariableScopeVisitor.java index 046489c0c9..13be7b5bab 100644 --- a/modules/nf-lang/src/main/java/nextflow/script/control/VariableScopeVisitor.java +++ b/modules/nf-lang/src/main/java/nextflow/script/control/VariableScopeVisitor.java @@ -260,7 +260,6 @@ public void visitParamV1(ParamNodeV1 node) { public void visitWorkflow(WorkflowNode node) { var classScope = workflowDsl(node.isEntry()); if( node.isEntry() && paramsType != null ) { - classScope = new ClassNode(classScope.getTypeClass()); var paramsMethod = classScope.getDeclaredMethods("getParams").get(0); paramsMethod.setReturnType(paramsType); } diff --git a/modules/nf-lang/src/test/groovy/nextflow/script/control/ScriptResolveTest.groovy b/modules/nf-lang/src/test/groovy/nextflow/script/control/ScriptResolveTest.groovy index 2c1e4329bd..7f80558d75 100644 --- a/modules/nf-lang/src/test/groovy/nextflow/script/control/ScriptResolveTest.groovy +++ b/modules/nf-lang/src/test/groovy/nextflow/script/control/ScriptResolveTest.groovy @@ -534,4 +534,21 @@ class ScriptResolveTest extends Specification { deleteDir(root) } + def 'should resolve piped operators in the entry workflow with a params block' () { + when: + def errors = check( + '''\ + params { + greeting: String = 'hello' + } + + workflow { + channel.of(1, 2) | view + } + ''' + ) + then: + errors.size() == 0 + } + }