forked from JavaTX/JavaCompilerCore
modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Alle Basistype bei Literalen hinzugefuegt.
This commit is contained in:
parent
f0ba7c03b5
commit
35696efd1c
@ -372,6 +372,18 @@ public class TYPEStmt implements StatementVisitor{
|
|||||||
//PL 2018-06-23 Sie haben einen Typ. Der muesste hier eingefuegt werden
|
//PL 2018-06-23 Sie haben einen Typ. Der muesste hier eingefuegt werden
|
||||||
//wie hier fuer double gezeigt. Im Momment auskommentiert, weil zu wenige Literaltypen
|
//wie hier fuer double gezeigt. Im Momment auskommentiert, weil zu wenige Literaltypen
|
||||||
//funktionieren
|
//funktionieren
|
||||||
|
if (literal.value instanceof Short) {
|
||||||
|
constraintsSet.addUndConstraint(new Pair(literal.getType(), shortt, PairOperator.EQUALSDOT));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (literal.value instanceof Byte) {
|
||||||
|
constraintsSet.addUndConstraint(new Pair(literal.getType(), bytee, PairOperator.EQUALSDOT));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (literal.value instanceof Float) {
|
||||||
|
constraintsSet.addUndConstraint(new Pair(literal.getType(), floatt, PairOperator.EQUALSDOT));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (literal.value instanceof Double) {
|
if (literal.value instanceof Double) {
|
||||||
constraintsSet.addUndConstraint(new Pair(literal.getType(), doublee, PairOperator.EQUALSDOT));
|
constraintsSet.addUndConstraint(new Pair(literal.getType(), doublee, PairOperator.EQUALSDOT));
|
||||||
return;
|
return;
|
||||||
@ -403,6 +415,16 @@ public class TYPEStmt implements StatementVisitor{
|
|||||||
constraint.add(new Pair(literal.getType(), floatt, PairOperator.EQUALSDOT));
|
constraint.add(new Pair(literal.getType(), floatt, PairOperator.EQUALSDOT));
|
||||||
oderConstraints.add(constraint);
|
oderConstraints.add(constraint);
|
||||||
}
|
}
|
||||||
|
if (clNames.stream().filter(x -> x.toString().equals("java.lang.Short")).findAny().isPresent()) {
|
||||||
|
constraint = new Constraint();
|
||||||
|
constraint.add(new Pair(literal.getType(), shortt, PairOperator.EQUALSDOT));
|
||||||
|
oderConstraints.add(constraint);
|
||||||
|
}
|
||||||
|
if (clNames.stream().filter(x -> x.toString().equals("java.lang.Byte")).findAny().isPresent()) {
|
||||||
|
constraint = new Constraint();
|
||||||
|
constraint.add(new Pair(literal.getType(), bytee, PairOperator.EQUALSDOT));
|
||||||
|
oderConstraints.add(constraint);
|
||||||
|
}
|
||||||
constraintsSet.addOderConstraint(oderConstraints);
|
constraintsSet.addOderConstraint(oderConstraints);
|
||||||
// */
|
// */
|
||||||
return;
|
return;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.lang.Float;
|
//import java.lang.Float;
|
||||||
//import java.lang.Byte;
|
//import java.lang.Byte;
|
||||||
import java.lang.Boolean;
|
import java.lang.Boolean;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user