stage2: implement error wrapping
* Sema: fix returned operands not coercing to the function return type
in some cases.
- When returning an error or an error union from a function with an
inferred error set, it will now populate the inferred error set.
- Implement error set coercion for the common case of inferred error
set to inferred error set, without forcing a full resolution.
* LLVM backend: update instruction lowering that handles error unions
to respect `isByRef`.
- Also implement `wrap_err_union_err`.
This commit is contained in:
@@ -782,6 +782,10 @@ pub const ErrorSet = struct {
|
||||
/// The length is given by `names_len`.
|
||||
names_ptr: [*]const []const u8,
|
||||
|
||||
pub fn names(self: ErrorSet) []const []const u8 {
|
||||
return self.names_ptr[0..self.names_len];
|
||||
}
|
||||
|
||||
pub fn srcLoc(self: ErrorSet) SrcLoc {
|
||||
return .{
|
||||
.file_scope = self.owner_decl.getFileScope(),
|
||||
|
||||
Reference in New Issue
Block a user