aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig12
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),