Skip to content

Commit

Permalink
Make sure link errors propagate
Browse files Browse the repository at this point in the history
  • Loading branch information
ngallagher committed Jan 29, 2017
1 parent 6b72d05 commit 1a1195d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ private Package load(Path path) throws Exception {
FuturePackage result = new FuturePackage(task, path);

if(registry.putIfAbsent(path, result) == null) {
task.run();
task.run(); // call a validate method here
}
return registry.get(path);
return registry.get(path); // return the future package
}
}
return module;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public Statement compile(Scope scope, Path from) throws Exception {

if(reference.compareAndSet(null, result)) {
task.run();
return statement;
return result;
}
}
return reference.get();
return reference.get(); // return future package
}
return empty;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public PackageDefinition define(Scope scope) throws Exception {

if(reference.compareAndSet(null, result)) {
task.run();
return definition;
return result; // must be future package for errors
}
}
return reference.get();
return reference.get(); // return future package
}

private class Executable implements Callable<PackageDefinition> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public Result compile(Scope outer) throws Exception {
Scope scope = type.getScope();

annotations.apply(scope, type);
hierarchy.update(scope, type);
builder.declare(scope, type);
hierarchy.update(scope, type); // this may throw exception if missing type

return ResultType.getNormal(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public Result compile(Scope outer) throws Exception {
Type type = module.getType(alias);
Scope scope = type.getScope();

hierarchy.update(scope, type);
builder.declare(scope, type, values);
hierarchy.update(scope, type); // this may throw exception if missing type

return ResultType.getNormal(type);
}
Expand Down

0 comments on commit 1a1195d

Please sign in to comment.