#What's the difference between `inline fn` and `callconv(.Inline)`

1 messages · Page 1 of 1 (latest)

wild lantern
#

In the docs the only thing that is specified it that inline fn "makes that function become semantically inlined at the callsite", while callconv(.Inline) "forces a function to be inlined at all call sites. If the function cannot be inlined, it is a compile-time error.".

The key word here seems to be "semantically", but I'm not sure what that means in this context.

Thanks.

uneven hollow
#

For one, IIUC, comptime values from the callsite stay comptime inside the function body (which wouldn't be the case otherwise), as shown in the docs. My assumption is that callconv(.Inline) only forces inlining on machine code level, but not semantically.

forest pawn
#

I believe that the only intended difference is that the latter can depend on a comptime condition

uneven hollow