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

Method substitute

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

Source from the content-addressed store, hash-verified

5936 }
5937
5938 @Override
5939 public Type.Tuple substitute(java.util.function.Function<Object, Syntactic.Item> binding) {
5940 for(int i=0;i!=size();++i) {
5941 Type before = get(i);
5942 Type after = before.substitute(binding);
5943 if(after == null) {
5944 return null;
5945 } else if(before != after) {
5946 // Committed to change
5947 Type[] types = new Type[size()];
5948 for(int j=0;j!=types.length;++j) {
5949 types[j] = get(j).substitute(binding);
5950 }
5951 return new Tuple(types);
5952 }
5953 }
5954 return this;
5955 }
5956
5957 @Override
5958 public Type.Tuple clone(Syntactic.Item[] operands) {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.95
getMethod · 0.95
substituteMethod · 0.95

Tested by

no test coverage detected