forked from JavaTX/JavaCompilerCore
modified: src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Bei Literal die Zuweisung des Typs eingefuegt aber wieder auskommentiert, weil es im Moment nur double Literals gibt. modified: test/javFiles/Lambda.jav
This commit is contained in:
parent
2eb7a63480
commit
0ecaf36648
@ -329,6 +329,15 @@ public class TYPEStmt implements StatementVisitor{
|
||||
@Override
|
||||
public void visit(Literal literal) {
|
||||
//Nothing to do here. Literale erzeugen keine Constraints
|
||||
//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
|
||||
//funktionieren
|
||||
//if (literal.value instanceof Double) {
|
||||
// constraintsSet.addUndConstraint(new Pair(literal.getType(), doublee, PairOperator.EQUALSDOT));
|
||||
//}
|
||||
//else {
|
||||
// throw new NotImplementedException();
|
||||
//}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,17 +1,12 @@
|
||||
import java.lang.Integer;
|
||||
import java.lang.Number;
|
||||
import java.util.Vector;
|
||||
class Apply { }
|
||||
|
||||
public class Lambda {
|
||||
|
||||
m () {
|
||||
var v;
|
||||
v.addElement(3);
|
||||
v.elementAt(1);
|
||||
var lam1 = (x) -> {
|
||||
return x;
|
||||
};
|
||||
return lam1.apply(1);
|
||||
return lam1.apply(new Apply());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user