| ... | @@ -6622,6 +6622,11 @@ fn instantiateGenericCall( | ... | @@ -6622,6 +6622,11 @@ fn instantiateGenericCall( |
| 6622 | } | 6622 | } |
| 6623 | | 6623 | |
| 6624 | const arg_ty = sema.typeOf(uncasted_args[i]); | 6624 | const arg_ty = sema.typeOf(uncasted_args[i]); |
| | 6625 | if (is_comptime or is_anytype) { |
| | 6626 | // Tuple default values are a part of the type and need to be |
| | 6627 | // resolved to hash the type. |
| | 6628 | try sema.resolveTupleLazyValues(block, call_src, arg_ty); |
| | 6629 | } |
| 6625 | | 6630 | |
| 6626 | if (is_comptime) { | 6631 | if (is_comptime) { |
| 6627 | const arg_val = sema.analyzeGenericCallArgVal(block, .unneeded, uncasted_args[i]) catch |err| switch (err) { | 6632 | const arg_val = sema.analyzeGenericCallArgVal(block, .unneeded, uncasted_args[i]) catch |err| switch (err) { |
| ... | @@ -6997,6 +7002,16 @@ fn instantiateGenericCall( | ... | @@ -6997,6 +7002,16 @@ fn instantiateGenericCall( |
| 6997 | return result; | 7002 | return result; |
| 6998 | } | 7003 | } |
| 6999 | | 7004 | |
| | 7005 | fn resolveTupleLazyValues(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Type) CompileError!void { |
| | 7006 | if (!ty.isTuple()) return; |
| | 7007 | const tuple = ty.tupleFields(); |
| | 7008 | for (tuple.values) |field_val, i| { |
| | 7009 | try sema.resolveTupleLazyValues(block, src, tuple.types[i]); |
| | 7010 | if (field_val.tag() == .unreachable_value) continue; |
| | 7011 | try sema.resolveLazyValue(block, src, field_val); |
| | 7012 | } |
| | 7013 | } |
| | 7014 | |
| 7000 | fn emitDbgInline( | 7015 | fn emitDbgInline( |
| 7001 | sema: *Sema, | 7016 | sema: *Sema, |
| 7002 | block: *Block, | 7017 | block: *Block, |
| ... | @@ -28606,6 +28621,20 @@ fn resolveLazyValue( | ... | @@ -28606,6 +28621,20 @@ fn resolveLazyValue( |
| 28606 | const ty = val.castTag(.lazy_size).?.data; | 28621 | const ty = val.castTag(.lazy_size).?.data; |
| 28607 | return sema.resolveTypeLayout(block, src, ty); | 28622 | return sema.resolveTypeLayout(block, src, ty); |
| 28608 | }, | 28623 | }, |
| | 28624 | .comptime_field_ptr => { |
| | 28625 | const field_ptr = val.castTag(.comptime_field_ptr).?.data; |
| | 28626 | return sema.resolveLazyValue(block, src, field_ptr.field_val); |
| | 28627 | }, |
| | 28628 | .@"union" => { |
| | 28629 | const union_val = val.castTag(.@"union").?.data; |
| | 28630 | return sema.resolveLazyValue(block, src, union_val.val); |
| | 28631 | }, |
| | 28632 | .aggregate => { |
| | 28633 | const aggregate = val.castTag(.aggregate).?.data; |
| | 28634 | for (aggregate) |elem_val| { |
| | 28635 | try sema.resolveLazyValue(block, src, elem_val); |
| | 28636 | } |
| | 28637 | }, |
| 28609 | else => return, | 28638 | else => return, |
| 28610 | } | 28639 | } |
| 28611 | } | 28640 | } |