aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/type.zig b/src/type.zig
index f14ad3a85b..765f1da18c 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -3935,7 +3935,6 @@ pub const Type = extern union {
/// Returns true if the type is optional and would be lowered to a single pointer
/// address value, using 0 for null. Note that this returns true for C pointers.
- /// See also `hasOptionalRepr`.
pub fn isPtrLikeOptional(self: Type) bool {
switch (self.tag()) {
.optional_single_const_pointer,
@@ -4631,6 +4630,14 @@ pub const Type = extern union {
}
/// Asserts the type is a function.
+ pub fn fnCallingConventionAllowsZigTypes(self: Type) bool {
+ return switch (self.fnCallingConvention()) {
+ .Unspecified, .Async, .Inline, .PtxKernel => true,
+ else => false,
+ };
+ }
+
+ /// Asserts the type is a function.
pub fn fnIsVarArgs(self: Type) bool {
return switch (self.tag()) {
.fn_noreturn_no_args => false,