A user-defined type declared inside a namespace can be used inside the namespace without full qualification (aka explicit full scope resolution in name) but functions seem to require the use of their full names regardless of location of usage.
Consider the following declarations:
namespace ns {
struct S {
u8 c = 3;
};
fn fun(auto arg) {
return arg+1;
};
}
Using them the following code runs correctly:
import std.io as io;
namespace ns {
S s;
io::print("{}",ns::fun(s.c));
}
but dropping the full name from fun causes an error indicating that the function could not be found as shown in the next image. Either both S and fun should need their full name or neither should.
A user-defined type declared inside a namespace can be used inside the namespace without full qualification (aka explicit full scope resolution in name) but functions seem to require the use of their full names regardless of location of usage.
Consider the following declarations:
Using them the following code runs correctly:
but dropping the full name from fun causes an error indicating that the function could not be found as shown in the next image. Either both S and fun should need their full name or neither should.