mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
FunctionType: substitute angepasst
This commit is contained in:
parent
2adc72cf74
commit
aafb8ead44
@ -41,23 +41,7 @@ public class FunctionType extends Type {
|
||||
*/
|
||||
@Override
|
||||
public FunctionType substitute(TypeVariable a, Type b) {
|
||||
boolean first = false;
|
||||
boolean second = false;
|
||||
if (this.parameter.contains(a)) {
|
||||
first = true;
|
||||
}
|
||||
if (this.output.contains(a)) {
|
||||
second = true;
|
||||
}
|
||||
if (first && second) {
|
||||
return new FunctionType(parameter.substitute(a, b), output.substitute(a, b));
|
||||
} else if (first) {
|
||||
return new FunctionType(parameter.substitute(a, b), output);
|
||||
} else if (second) {
|
||||
return new FunctionType(parameter, output.substitute(a, b));
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return new FunctionType(parameter.substitute(a, b), output.substitute(a, b));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user