Explorer

core.pattern-target-variants

description
Variants a pattern can name for a target of type (the union's variants, true / false for booleans, none otherwise)
type
Fn(type: @core.type-ast, env: @core.type-env) -> List<Record{tag: String, payload_type: Union{#none, #some(@core.type-ast)}}>
expression
fn(type$0, env$1) =>
  match @core.type-resolve(type: $0, env: $1) {
    #union(variants$10) =>
      $10,
    #boolean(_) =>
      [{tag: "true", payload_type: #none}, {tag: "false", payload_type: #none}],
    _ =>
      []
  }
visibility
public
core.pattern-target-variants (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: xYVrcnltMql4jm8eMUlSpS9SLm11DDSt3DxYFMaYbL8
content hash: iZr5_xL_Rj5i8uVcsfCfcfDe8MEy4yUDbj1IQ1p0SpI