you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 year ago

I completely forgot that unit structs/variants define their own associated consts. I wonder if in patterns the type can be used instead of the associated const though? That might resolve a lot of the headache. It'd mean changing the way the ident is resolved to looking in the type namespace though.

const <block> already works as a pattern I believe? That could be used instead for constants.

Literals would always work in-place as constant expressions.

  • source
  • parent