master
 1const FileOpenError = error{
 2    AccessDenied,
 3    OutOfMemory,
 4    FileNotFound,
 5};
 6
 7const AllocationError = error{
 8    OutOfMemory,
 9};
10
11test "coerce superset to subset" {
12    foo(FileOpenError.OutOfMemory) catch {};
13}
14
15fn foo(err: FileOpenError) AllocationError {
16    return err;
17}
18
19// test_error=not a member of destination error set