Skip to content

Commit 9e296b8

Browse files
authored
Remove unnecessary runtime checks with strict syntax (#6539)
Signed-off-by: Ben Sherman <[email protected]>
1 parent 6d2a34f commit 9e296b8

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

modules/nextflow/src/main/groovy/nextflow/script/ScriptMeta.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ class ScriptMeta {
199199
final name = component.name
200200
if( !module && NF.hasOperator(name) )
201201
log.warn "${component.type.capitalize()} with name '$name' overrides a built-in operator with the same name"
202-
checkComponentName(component, name)
202+
if( !NF.isSyntaxParserV2() )
203+
checkComponentName(component, name)
203204
definitions.put(component.name, component)
204205
if( component instanceof FunctionDef ){
205206
incFunctionCount(name)
@@ -339,13 +340,12 @@ class ScriptMeta {
339340
assert component
340341

341342
final name = alias ?: component.name
342-
checkComponentName(component, name)
343-
if( name != component.name ) {
343+
if( !NF.isSyntaxParserV2() )
344+
checkComponentName(component, name)
345+
if( name != component.name )
344346
imports.put(name, component.cloneWithName(name))
345-
}
346-
else {
347+
else
347348
imports.put(name, component)
348-
}
349349
}
350350

351351
@Memoized

modules/nextflow/src/main/groovy/nextflow/script/parser/v2/ScriptLoaderV2.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ class ScriptLoaderV2 implements ScriptLoader {
156156
final meta = ScriptMeta.get(script)
157157
meta.setScriptPath(path)
158158
meta.setModule(module)
159-
meta.validate()
160159
binding.setScriptPath(path)
161160
binding.setSession(session)
162161
return script

0 commit comments

Comments
 (0)