Zig Version
0.17.0-dev.251+0db721ec2
Steps to Reproduce and Observed Behavior
getUserInfo
The problem initially starts here, when using std.process.getUserInfo:
conststd=@import("std");pubfnmain()!void{constname:[]constu8="root";constuserinfo=trystd.process.getUserInfo(name);std.debug.print("hello {d}\n",.{userinfo.uid});}
Error
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/process.zig:118:12: error: expected 2 argument(s), found 1
=> posixGetUserInfo(name),
^~~~~~~~~~~~~~~~
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/process.zig:125:5: note: function declared here
pub fn posixGetUserInfo(io: Io, name: []const u8) !UserInfo {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main: main.zig:5:49
callMain [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:699:59
callMainWithArgs [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:639:20
posixCallMainAndExit: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:591:38
2 reference(s) hidden; use '-freference-trace=6' to see all references
posixGetUserInfo
Then when trying to use the underlying posixGetUserInfo:
conststd=@import("std");pubfnmain(init:std.process.Init)!void{constname:[]constu8="root";constuserinfo=trystd.process.posixGetUserInfo(init.io,name);std.debug.print("hello {d}\n",.{userinfo.uid});}
This error is no longer a public API error but one internal to posixGetUserInfo.
Error
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/process.zig:129:27: error: member function expected 2 argument(s), found 1
var file_reader = file.reader(&buffer);
~~~~^~~~~~~
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/Io/File.zig:566:5: note: function declared here
pub fn reader(file: File, io: Io, buffer: []u8) Reader {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main: main.zig:11:54
callMain [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:738:30
callMainWithArgs [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:639:20
posixCallMainAndExit: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:591:38
2 reference(s) hidden; use '-freference-trace=6' to see all references
Expected Behavior
Expected to compile given the name parameter, although this is unlikely to be possible given that the underlying issue is an Io interface not being propagated properly. That said, expected to compile given a fix to expect both an Io and name parameter.
### Zig Version
0.17.0-dev.251+0db721ec2
### Steps to Reproduce and Observed Behavior
## `getUserInfo`
The problem initially starts here, when using `std.process.getUserInfo`:
```zig
const std = @import("std");
pub fn main() !void {
const name:[]const u8 = "root";
const userinfo = try std.process.getUserInfo(name);
std.debug.print("hello {d}\n", .{userinfo.uid});
}
```
### Error
```sh
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/process.zig:118:12: error: expected 2 argument(s), found 1
=> posixGetUserInfo(name),
^~~~~~~~~~~~~~~~
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/process.zig:125:5: note: function declared here
pub fn posixGetUserInfo(io: Io, name: []const u8) !UserInfo {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main: main.zig:5:49
callMain [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:699:59
callMainWithArgs [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:639:20
posixCallMainAndExit: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:591:38
2 reference(s) hidden; use '-freference-trace=6' to see all references
```
## `posixGetUserInfo`
Then when trying to use the underlying `posixGetUserInfo`:
```zig
const std = @import("std");
pub fn main(init: std.process.Init) !void {
const name:[]const u8 = "root";
const userinfo = try std.process.posixGetUserInfo(init.io, name);
std.debug.print("hello {d}\n", .{userinfo.uid});
}
```
This error is no longer a public API error but one internal to `posixGetUserInfo`.
### Error
```sh
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/process.zig:129:27: error: member function expected 2 argument(s), found 1
var file_reader = file.reader(&buffer);
~~~~^~~~~~~
/home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/Io/File.zig:566:5: note: function declared here
pub fn reader(file: File, io: Io, buffer: []u8) Reader {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main: main.zig:11:54
callMain [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:738:30
callMainWithArgs [inlined]: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:639:20
posixCallMainAndExit: /home/thomas/.local/zig-x86_64-linux-0.17.0-dev.251+0db721ec2/lib/std/start.zig:591:38
2 reference(s) hidden; use '-freference-trace=6' to see all references
```
### Expected Behavior
Expected to compile given the `name` parameter, although this is unlikely to be possible given that the underlying issue is an `Io` interface not being propagated properly. That said, expected to compile given a fix to expect both an `Io` and `name` parameter.