Compare commits
2 Commits
b76e1e46f0
...
4318856fa8
Author | SHA1 | Date | |
---|---|---|---|
4318856fa8 | |||
1ace099d72 |
@ -103,22 +103,22 @@ public class TYPE {
|
|||||||
|
|
||||||
var subPatternList = recordPattern.getSubPattern();
|
var subPatternList = recordPattern.getSubPattern();
|
||||||
var resolver = new GenericsResolverSameName();
|
var resolver = new GenericsResolverSameName();
|
||||||
|
var refType = (RefType) recordPattern.getType();
|
||||||
|
|
||||||
|
var allClasses = blockInformation.getAvailableClasses();
|
||||||
|
var typename = refType.getName().getClassName();
|
||||||
|
|
||||||
|
ClassOrInterface allClass = allClasses.stream().filter(c -> c.getClassName().getClassName().equals(typename)).findFirst().orElseThrow();
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
for (Pattern el : subPatternList){
|
for (Pattern el : subPatternList){
|
||||||
if (el instanceof RecordPattern){
|
if (el instanceof RecordPattern){
|
||||||
constraintSet.addAll(addRecursiveParameterConstraints((RecordPattern) el, blockInformation));
|
constraintSet.addAll(addRecursiveParameterConstraints((RecordPattern) el, blockInformation));
|
||||||
} else if (recordPattern.getType() instanceof RefType refType){
|
} else {
|
||||||
var allClasses = blockInformation.getAvailableClasses();
|
|
||||||
var typename = refType.getName().getClassName();
|
|
||||||
|
|
||||||
for (ClassOrInterface allClass : allClasses) {
|
|
||||||
var className = allClass.getClassName().getClassName();
|
|
||||||
if(className.equals(typename)){
|
|
||||||
FormalParameter param = (FormalParameter) allClass.getConstructors().getFirst().getParameterList().getParameterAt(counter);
|
FormalParameter param = (FormalParameter) allClass.getConstructors().getFirst().getParameterList().getParameterAt(counter);
|
||||||
FieldAssumption assumption = new FieldAssumption(param.getName(), allClass, param.getType(), blockInformation.getCurrentTypeScope());
|
FieldAssumption assumption = new FieldAssumption(param.getName(), allClass, param.getType(), blockInformation.getCurrentTypeScope());
|
||||||
|
|
||||||
var fieldCons = new Pair(el.getType(), assumption.getType(resolver), PairOperator.EQUALSDOT);
|
var fieldCons = new Pair(el.getType(), assumption.getType(resolver), PairOperator.SMALLERDOT);
|
||||||
var recvCons = new Pair(refType, assumption.getReceiverType(resolver), PairOperator.EQUALSDOT);
|
var recvCons = new Pair(refType, assumption.getReceiverType(resolver), PairOperator.EQUALSDOT);
|
||||||
constraintSet.addUndConstraint(fieldCons);
|
constraintSet.addUndConstraint(fieldCons);
|
||||||
constraintSet.addUndConstraint(recvCons);
|
constraintSet.addUndConstraint(recvCons);
|
||||||
@ -129,9 +129,6 @@ public class TYPE {
|
|||||||
PairOperator.EQUALSDOT));
|
PairOperator.EQUALSDOT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user