The outer content can’t be used in the bar function, if it is not of comptime.
const std = @import("std");
fn foo(content: []const u8) void {
const T = struct {
// error: function parameter 'content' shadows function parameter from outer scope
fn bar(_: @This(), content: []const u8) void {
std.debug.print(">> {s}\n", .{content});
}
};
const t = T{};
t.bar(content[0..3]);
}
pub fn main() !void {
foo("abcde");
}