cx icon indicating copy to clipboard operation
cx copied to clipboard

Slice bool: Problem with output of function

Open canhdoan opened this issue 5 years ago • 3 comments

Describe the bug Can not get slice's bool as an output of a func

package main

func foo()(out []bool) {
  out = append(out, true)
  out = append(out, true)
  out = append(out, true)
}

func main() {
  var bar []bool
  bar = foo()
  i32.print(len(bar))
}

Result len(bar) = 0

canhdoan avatar Oct 30 '19 18:10 canhdoan

@arfan499 Can you try to run this one and report result.

If it fails, then put in regression tests.

SkycoinSynth avatar Feb 04 '21 09:02 SkycoinSynth

Can not get slice's bool as an output of a func and the result is still zero.
Result: len(bar) = 0

arfan499 avatar Feb 04 '21 09:02 arfan499

I have tested this code and result is 3, as it should be.

Code seems to work fine now.

archerixx avatar Mar 18 '21 18:03 archerixx