motoko icon indicating copy to clipboard operation
motoko copied to clipboard

Allow pattern matching on type fields of modules

Open christoph-dfinity opened this issue 8 months ago • 1 comments

My goal here is to allow importing types in an unqualified manner without having to add an extra binding.

import { type Result } "mo:base/Result";

// instead of

import Result "mo:base/Result";
type Result<Ok, Err> = Result.Result<Ok, Err>

Following up on https://github.com/dfinity/motoko/pull/3362

christoph-dfinity avatar Apr 15 '25 09:04 christoph-dfinity

+1 (would've benefited from this dozens of times in various situations). Maybe P3 priority or P2 if we find some compelling use cases?

rvanasa avatar Apr 15 '25 19:04 rvanasa

Released in version 0.15.1

christoph-dfinity avatar Aug 05 '25 13:08 christoph-dfinity