~sircmpwn/hare#910: 
Build driver doesn't know what to do when same module is accessible via multiple harepaths

$ mkdir -p a/b
$ cat > a/b/c.ha << 'EOF'
. export let c = 42;
. EOF
$ cat > main.ha << 'EOF'
. use ab = a::b;
. use b;
. export fn main() void = {
.     assert(ab::c == b::c);
.     ab::c += 1;
.     assert(ab::c == b::c); // ???
. };
. EOF
$ HAREPATH=a:$HAREPATH hare run
0/9 tasks completed (0%)
Could not open module 'b': typedef variable $HARE_TD_b not set

harec for /tmp/main.ha exited with status 1

Should this be allowed at all? If so, should the assertion succeed?

I think that we shouldn't allow this at all, and should just error more gracefully.

Status
REPORTED
Submitter
~sebsite
Assigned to
No-one
Submitted
7 months ago
Updated
2 months ago
Labels
driver

~ecs 7 months ago

i think we should allow this

~sebsite 7 months ago

It's worth noting that my namespaces spec patch currently says that every module (except the root module) must have exactly one namespace. If we allow this, then the spec would need to be updated to allow a module to have multiple namespaces.

~ecs REPORTED FIXED 2 months ago

Ember Sawady referenced this ticket in commit c681f10.

~ecs FIXED REPORTED 2 months ago

Register here or Log in to comment, or comment via email.