Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected String -> Array[String] coercion #3478

Closed
danxmoran opened this issue Apr 4, 2018 · 0 comments
Closed

Unexpected String -> Array[String] coercion #3478

danxmoran opened this issue Apr 4, 2018 · 0 comments

Comments

@danxmoran
Copy link
Contributor

Cromwell version: 30-9a7de06

Minimized from one of our WDLs:

workflow Test {
  Boolean do
  Int n

  if (do) {
    call Optional
  }

  scatter (i in range(n)) {
    call Scattered
  }

  call Gather {
    input:
      # HERE: select_first returns String, and Scattered.out is an Array[String]
      ins = if defined(Optional.out) then select_first([Optional.out]) else Scattered.out
  }
  output {
    Gather.out
  }
}

task Optional {
  command {
    echo "Hey!"
  }
  output {
    String out = read_string(stdout())
  }
}

task Scattered {
  command {
    echo "Hello!"
  }
  output {
    String out = read_string(stdout())
  }
}

task Gather {
  Array[String] ins

  command {
    cat ${write_lines(ins)}
  }
  output {
    String out = read_string(stdout())
  }
}

This WDL runs successfully, but in code review I noticed the weird type mismatch between the branches. I asked @cjllanwarne about it and he thought it was an old "feature" that had been purged to avoid bugs / confusion. I'd expect something like this to be rejected.

@cjllanwarne cjllanwarne added this to the CUI Q3 - WDL as a Conformant Engine milestone Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants