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

Method substitute

src/main/java/wyil/check/FlowTypeUtils.java:1259–1271  ·  view source on GitHub ↗
(Type[] types, Function<Object, Syntactic.Item> binder)

Source from the content-addressed store, hash-verified

1257 }
1258
1259 private static Type[] substitute(Type[] types, Function<Object, Syntactic.Item> binder) {
1260 // NOTE: optimisation to prevent allocation
1261 Type[] nTypes = types;
1262 for (int j = 0; j != nTypes.length; ++j) {
1263 Type before = types[j];
1264 Type after = before.substitute(binder);
1265 if (before != after && nTypes == types) {
1266 nTypes = Arrays.copyOf(types, types.length);
1267 }
1268 nTypes[j] = after;
1269 }
1270 return nTypes;
1271 }
1272
1273 // ===============================================================================================================
1274 // Binding

Callers

nothing calls this directly

Calls 1

substituteMethod · 0.95

Tested by

no test coverage detected