forked from JavaTX/JavaCompilerCore
unifier
This commit is contained in:
parent
ae37dd6255
commit
c45c426011
29
src/de/dhbwstuttgart/typeinference/unifynew/Unifier.java
Normal file
29
src/de/dhbwstuttgart/typeinference/unifynew/Unifier.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package de.dhbwstuttgart.typeinference.unifynew;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.typinference.unify.model.Type;
|
||||||
|
import de.dhbwstuttgart.typinference.unify.model.TypeParams;
|
||||||
|
|
||||||
|
public class Unifier implements Function<Type, Type> {
|
||||||
|
private Type source;
|
||||||
|
private Type target;
|
||||||
|
|
||||||
|
public Unifier(Type source, Type target) {
|
||||||
|
this.source = source;
|
||||||
|
this.target = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type apply(Type t) {
|
||||||
|
return t.apply(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Type getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Type getTarget() {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user