| ... | @@ -28356,7 +28356,7 @@ fn coerceExtra( | ... | @@ -28356,7 +28356,7 @@ fn coerceExtra( |
| 28356 | | 28356 | |
| 28357 | // E!T to T | 28357 | // E!T to T |
| 28358 | if (inst_ty.zigTypeTag(zcu) == .error_union and | 28358 | if (inst_ty.zigTypeTag(zcu) == .error_union and |
| 28359 | (try sema.coerceInMemoryAllowed(block, inst_ty.errorUnionPayload(zcu), dest_ty, false, target, dest_ty_src, inst_src, null)) == .ok) | 28359 | (try sema.coerceInMemoryAllowed(block, dest_ty, inst_ty.errorUnionPayload(zcu), false, target, dest_ty_src, inst_src, null)) == .ok) |
| 28360 | { | 28360 | { |
| 28361 | try sema.errNote(inst_src, msg, "cannot convert error union to payload type", .{}); | 28361 | try sema.errNote(inst_src, msg, "cannot convert error union to payload type", .{}); |
| 28362 | try sema.errNote(inst_src, msg, "consider using 'try', 'catch', or 'if'", .{}); | 28362 | try sema.errNote(inst_src, msg, "consider using 'try', 'catch', or 'if'", .{}); |
| ... | @@ -28364,7 +28364,7 @@ fn coerceExtra( | ... | @@ -28364,7 +28364,7 @@ fn coerceExtra( |
| 28364 | | 28364 | |
| 28365 | // ?T to T | 28365 | // ?T to T |
| 28366 | if (inst_ty.zigTypeTag(zcu) == .optional and | 28366 | if (inst_ty.zigTypeTag(zcu) == .optional and |
| 28367 | (try sema.coerceInMemoryAllowed(block, inst_ty.optionalChild(zcu), dest_ty, false, target, dest_ty_src, inst_src, null)) == .ok) | 28367 | (try sema.coerceInMemoryAllowed(block, dest_ty, inst_ty.optionalChild(zcu), false, target, dest_ty_src, inst_src, null)) == .ok) |
| 28368 | { | 28368 | { |
| 28369 | try sema.errNote(inst_src, msg, "cannot convert optional to payload type", .{}); | 28369 | try sema.errNote(inst_src, msg, "cannot convert optional to payload type", .{}); |
| 28370 | try sema.errNote(inst_src, msg, "consider using '.?', 'orelse', or 'if'", .{}); | 28370 | try sema.errNote(inst_src, msg, "consider using '.?', 'orelse', or 'if'", .{}); |