nextflow-io / nextflow-io/language-server
Static typing: false 'Argument … is not compatible' warning on process→process record wiring (cross-file check ordering)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 31
- Forks
- 8
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Description
Description
When a typed process's record(...) output is passed directly into another typed process whose input is the identical record type, the language server reports a spurious type-mismatch warning:
Argument with type Record is not compatible with process input of type Record {
id: String
data: Path
}
The producer's output type and the consumer's input type are structurally identical, and hover on the argument confirms it is fully structural (Channel<Record { id: String, data: Path }>). The warning appears to be a cross-file check-ordering issue: the consuming file is type-checked before the producer process's output type has been resolved, so the argument is momentarily seen as a bare Record.
Reproduction
Three files:
modules/producer.nf
nextflow.enable.types = true
process PRODUCER {
input:
record(id: String)
output:
record(id: id, data: file('data.txt'))
script:
"""
echo hello > data.txt
"""
}
modules/consumer.nf
nextflow.enable.types = true
process CONSUMER {
input:
record(id: String, data: Path)
output:
record(id: id)
script:
"""
cat ${data}
"""
}
main.nf
nextflow.enable.types = true
include { PRODUCER } from './modules/producer.nf'
include { CONSUMER } from './modules/consumer.nf'
workflow {
ch_produced = PRODUCER(channel.of(record(id: 'sample1'))) // Channel<Record{id: String, data: Path}>
CONSUMER(ch_produced) // input: record(id: String, data: Path)
}
Type-checking the workspace reports, at the CONSUMER(ch_produced) call (main.nf:8):
warning: Argument with type Record is not compatible with process input of type Record { id: String data: Path }
There are no real errors — PRODUCER's output Record{id: String, data: Path} satisfies CONSUMER's input record(id: String, data: Path).
Expected
No warning.
Observations that point to a resolution race / staleness
- Deterministic in a cold/headless full-workspace scan — driving the server over stdio and collecting published diagnostics reproduces it every run (3/3).
- In VS Code / a long-lived server the warning clears as soon as the consuming file is re-checked after the modules have resolved — e.g. adding/removing a blank line in
main.nfmakes it disappear. - Editing a module does not re-check its consumers, so a stale false warning lingers in the editor until the consuming file is touched.
- Feeding a same-shaped record from a named record type channel (
Channel<MyRecord>) or from.map { record(...) }does not trigger it — only a value taken directly from an upstream process's output does. This is consistent with the producer's output type not being resolved at the moment the consumer call is checked.
Versions
- language-server
v26.04.1andv26.04.2(both reproduce) - Nextflow 26.04.4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the warning with modules/producer.nf, modules/consumer.nf, and main.nf, using the cold/headless stdio workspace scan described in the issue. Trace how the producer output and the CONSUMER(ch_produced) call are checked across files. Done means the identical record wiring produces no diagnostic and consumers are re-checked after module types resolve.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100