Skip to content

Can we make unwrap_{left,right} not require the generic parameter with the unused type? #319

@schoen

Description

@schoen

Project

compiler

Describe the feature

Right now the macros unwrap_left and unwrap_right require you to specify the type of the Either branch that you're not using. For example, if you unwrap_right an unconfidential Amount1's Some object, you have to specify the type of the confidential amount that you don't expect as output, like

let amt: u64 = unwrap_right::<(u1, u256)>(amt1);

Could we make unwrap_left and unwrap_right figure out these types automatically rather than specifying them? E.g. just left amt: u64 = unwrap_right(amt1) without needing to say what the Left object would have been if it had been present, since we're also asserting that it's not present?

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