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

Method substitute

src/main/java/wyil/lang/WyilFile.java:6925–6945  ·  view source on GitHub ↗
(Tuple<Type> types,
			java.util.function.Function<Object, Syntactic.Item> binding)

Source from the content-addressed store, hash-verified

6923 }
6924
6925 private static Tuple<Type> substitute(Tuple<Type> types,
6926 java.util.function.Function<Object, Syntactic.Item> binding) {
6927 for (int i = 0; i != types.size(); ++i) {
6928 Type before = types.get(i);
6929 Type after = before.substitute(binding);
6930 if (before != after) {
6931 // Committed to change
6932 Type[] nTypes = new Type[types.size()];
6933 for (int j = 0; j != nTypes.length; ++j) {
6934 after = types.get(j).substitute(binding);
6935 if(after == null) {
6936 return null;
6937 }
6938 nTypes[j] = after;
6939 }
6940 return new Tuple<>(nTypes);
6941 }
6942 }
6943 //
6944 return types;
6945 }
6946
6947 private static Type[] substitute(Type[] types, java.util.function.Function<Object, Syntactic.Item> binding) {
6948 Type[] nTypes = types;

Callers 2

substituteMethod · 0.95
substituteMethod · 0.95

Calls 3

substituteMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected