Skip to content

Allow underscore for unused value in match statement #241

@schoen

Description

@schoen

Project

core

Describe the feature

https://docs.simplicity-lang.org/simplicityhl-reference/let_statement/#pattern-matching notes that _ can be used for a discarded value inside the let statement (in that case when destructuring tuples), but there appears to be no equivalent for the match statement, even though it could be useful to throw away the value (e.g. a specific Either branch could be a fatal error in a certain context, so we don't care about the actual values in that branch, so we might want to match Right(_: (u256, u64, Signature)) or whatever in order to confirm that we're going to throw away the actual values.

Currently using syntax like this gave me an error from simc about an expected identifier.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions