Zig Version
zig-0.11.0-dev.2704+83970b6d9
Steps to Reproduce and Observed Behavior
Consider the following:
constFnProto=fn (arg1: anytype, arg2: @TypeOf(arg1.some_field)) u32;
Compiler says: error: use of undeclared identifier 'arg1'
On the other hand we can get that type using another function
fndummy(arg1: anytype, arg2: @TypeOf(arg1.some_field)) u32 {
_=arg2;
return0;
}
constFnProto=@TypeOf(dummy);but I think that this is not the way out. Moreover, we may face to incorrect error message if there is a declaration with the same name as the parameter
constFnProto=fn (arg1: anytype, arg2: @TypeOf(arg1.some_field)) u32;
constarg1: u64=0;
error: type 'u64' does not support field access
Expected Behavior
So maybe function prototypes should have their own scope?
Zig Version
zig-0.11.0-dev.2704+83970b6d9
Steps to Reproduce and Observed Behavior
Consider the following:
Compiler says:
error: use of undeclared identifier 'arg1'On the other hand we can get that type using another function
but I think that this is not the way out. Moreover, we may face to incorrect error message if there is a declaration with the same name as the parameter
Expected Behavior
So maybe function prototypes should have their own scope?