fix: print error set members in a consistent order
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
This commit is contained in:
committed by
Matthew Lugg
parent
e395c24c6d
commit
e9eee8dace
11
test/cases/compile_errors/error_set_display.zig
Normal file
11
test/cases/compile_errors/error_set_display.zig
Normal file
@@ -0,0 +1,11 @@
|
||||
const Set0 = error{ A, B, C, D, E, F };
|
||||
const Set1 = error{ F, E, D, C, A };
|
||||
comptime {
|
||||
const x = Set0.B;
|
||||
const y: Set1 = @errorCast(x);
|
||||
_ = y;
|
||||
}
|
||||
|
||||
// error
|
||||
//
|
||||
// :5:21: error: 'error.B' not a member of error set 'error{A,C,D,E,F}'
|
||||
@@ -54,8 +54,8 @@ export fn ptr_to_underaligned_ptr() void {
|
||||
|
||||
// error
|
||||
//
|
||||
// :16:33: error: expected type '*error{Foo,Bar}', found '*error{Foo}'
|
||||
// :16:33: note: pointer type child 'error{Foo}' cannot cast into pointer type child 'error{Foo,Bar}'
|
||||
// :16:33: error: expected type '*error{Bar,Foo}', found '*error{Foo}'
|
||||
// :16:33: note: pointer type child 'error{Foo}' cannot cast into pointer type child 'error{Bar,Foo}'
|
||||
// :16:33: note: 'error.Bar' not a member of destination error set
|
||||
// :22:24: error: expected type '*anyerror', found '*error{Foo}'
|
||||
// :22:24: note: pointer type child 'error{Foo}' cannot cast into pointer type child 'anyerror'
|
||||
|
||||
Reference in New Issue
Block a user