Stream: bugs

Topic: Ok(u8_num) => u8_num shows as <unsupported>


view this post on Zulip Astating (Dec 03 2025 at 13:16):

edit: GH issue: https://github.com/roc-lang/roc/issues/8555

Hi !

Here's a repro for a bug when extracting an ok value and it's a u8.
Printing the entire Ok works, extracting a u64 value works, extracting a u8 value fails :

app [main!] { pf: platform "./platform/main.roc" }

import pf.Stdout
import pf.Stderr

# -> 8
extract_ok_u64_works : U64
extract_ok_u64_works = {
  list: List(U64)
  list = [8, 7]

  match(list.first()) {
    Err(_) => 0
    Ok(first) => first
  }
}

# -> Ok(8)
print_ok_u8_works : Try(U8, [ListWasEmpty])
print_ok_u8_works = {
  list: List(U8)
  list = [8, 7]

  list.first()
}

# -> <unsupported>
extract_ok_u8_fails : U8
extract_ok_u8_fails = {
  list: List(U8)
  list = [8, 7]

  match(list.first()) {
    Err(_) => 0
    Ok(first) => first
  }
}

main! = || {
  dbg extract_ok_u64_works
  dbg print_ok_u8_works
  dbg extract_ok_u8_fails
}

view this post on Zulip Anton (Dec 03 2025 at 13:18):

Hi @Astating,
Can you make a github issue for this so we don't lose track of it?


Last updated: Dec 21 2025 at 12:15 UTC