diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-08-22 10:54:07 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-08-22 11:16:36 +0300 |
| commit | 560baf67ce77de41da3d03183300cdf1b6d90567 (patch) | |
| tree | 344f2d67d7e85c64e3bf843369032db575cca996 /src | |
| parent | b0bcd4add29b6fbbe2bbc22719703d3c81ed594b (diff) | |
| download | zig-560baf67ce77de41da3d03183300cdf1b6d90567.tar.gz zig-560baf67ce77de41da3d03183300cdf1b6d90567.zip | |
Sema: fix implicit cast from extern fn to fn ptr
Closes #12570
Diffstat (limited to 'src')
| -rw-r--r-- | src/Sema.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 9538073e5c..42d5e96d3d 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -22564,7 +22564,7 @@ fn coerceExtra( // Function body to function pointer. if (inst_ty.zigTypeTag() == .Fn) { const fn_val = try sema.resolveConstValue(block, .unneeded, inst, undefined); - const fn_decl = fn_val.castTag(.function).?.data.owner_decl; + const fn_decl = fn_val.pointerDecl().?; const inst_as_ptr = try sema.analyzeDeclRef(fn_decl); return sema.coerce(block, dest_ty, inst_as_ptr, inst_src); } |
