diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-08-10 12:02:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-10 12:02:57 -0700 |
| commit | b820d5df79e714b3a3ad3c09480abdafff058de8 (patch) | |
| tree | b6fcf4066de92f3ab01a56166719757aef2e0a83 /src/type.zig | |
| parent | 275e926cf851144ef6a4c64963e47f3b955870cc (diff) | |
| parent | c4848694d20c19b78657ee46f18028737290c829 (diff) | |
| download | zig-b820d5df79e714b3a3ad3c09480abdafff058de8.tar.gz zig-b820d5df79e714b3a3ad3c09480abdafff058de8.zip | |
Merge pull request #16747 from jacobly0/llvm-wo-libllvm
llvm: enable the backend even when not linked to llvm
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/type.zig b/src/type.zig index 3db11ac42e..df39192a63 100644 --- a/src/type.zig +++ b/src/type.zig @@ -2664,10 +2664,10 @@ pub const Type = struct { .int_type => false, .ptr_type => |ptr_type| { const child_ty = ptr_type.child.toType(); - if (child_ty.zigTypeTag(mod) == .Fn) { - return false; - } else { - return child_ty.comptimeOnly(mod); + switch (child_ty.zigTypeTag(mod)) { + .Fn => return mod.typeToFunc(child_ty).?.is_generic, + .Opaque => return false, + else => return child_ty.comptimeOnly(mod), } }, .anyframe_type => |child| { @@ -2704,7 +2704,6 @@ pub const Type = struct { .c_longlong, .c_ulonglong, .c_longdouble, - .anyopaque, .bool, .void, .anyerror, @@ -2723,6 +2722,7 @@ pub const Type = struct { .extern_options, => false, + .anyopaque, .type, .comptime_int, .comptime_float, @@ -2769,7 +2769,7 @@ pub const Type = struct { } }, - .opaque_type => false, + .opaque_type => true, .enum_type => |enum_type| enum_type.tag_ty.toType().comptimeOnly(mod), |
