MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / fork

Method fork

src/main/java/wyil/check/FlowTypeCheck.java:3374–3381  ·  view source on GitHub ↗

Apply a given forking function to produce an array of forked environments. @param candidates The list of candidates for which the environment is forked where each candidate is forked into a new environment. @param fn The forking function which takes a given callable

(List<Decl.Callable> candidates, Function<Decl.Callable, Typing.Row> fn)

Source from the content-addressed store, hash-verified

3372 * @return
3373 */
3374 public Typing.Row[] fork(List<Decl.Callable> candidates, Function<Decl.Callable, Typing.Row> fn) {
3375 Typing.Row[] constraints = new Typing.Row[candidates.size()];
3376 for (int i = 0; i != candidates.size(); ++i) {
3377 constraints[i] = fn.apply(candidates.get(i));
3378 }
3379 // Remove any invalid environments which have arisen.
3380 return ArrayUtils.removeAll(constraints, null);
3381 }
3382
3383 public Type refine(Type declared, Type selector) {
3384 // FIXME: this method is a hack for now really, until such time as I resolve

Callers 4

pushInvokeMethod · 0.95
pushLambdaAccessMethod · 0.95
pullInvokeMethod · 0.95
pullLambdaAccessMethod · 0.95

Calls 4

removeAllMethod · 0.95
sizeMethod · 0.65
applyMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected