diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java index b989e0b5..55b052ee 100644 --- a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java +++ b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java @@ -2,10 +2,7 @@ package de.dhbwstuttgart.typedeployment; import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.syntaxtree.*; -import de.dhbwstuttgart.syntaxtree.type.GenericRefType; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.syntaxtree.type.*; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import org.antlr.v4.runtime.Token; @@ -112,8 +109,12 @@ public class TypeInsertFactory { if(typeParam instanceof TypePlaceholder){ insert += ((TypePlaceholder) typeParam).getName(); additionalInserts.add((TypePlaceholder) typeParam); - }else if(typeParam instanceof RefType){ + }else if(typeParam instanceof RefType) { insert += createInsertString((RefType) typeParam, additionalInserts); + }else if(typeParam instanceof SuperWildcardType){ + insert += "? super " + createInsertString(((SuperWildcardType) typeParam).getInnerType(), additionalInserts); + }else if(typeParam instanceof ExtendsWildcardType){ + insert += "? extends " + createInsertString(((ExtendsWildcardType) typeParam).getInnerType(), additionalInserts); }else throw new NotImplementedException(); if(iterator.hasNext())insert += ", "; } diff --git a/test/javFiles/mathStruc.jav b/test/javFiles/mathStruc.jav index a4ac4741..7bbb79be 100644 --- a/test/javFiles/mathStruc.jav +++ b/test/javFiles/mathStruc.jav @@ -4,15 +4,9 @@ mathStruc(A a) { ;} A model(){ A a; return a; } -void methode(){ +methode(){ auto innerOp = o -> ms -> new mathStruc(o.apply(this.model(),ms.model())); + return innerOp; } -} - -interface Fun1{ - A apply(B b); -} -interface Fun2{ - A apply(B b, C c); } \ No newline at end of file diff --git a/test/typeinference/JavaTXCompilerTest.java b/test/typeinference/JavaTXCompilerTest.java index 92f5754b..f62dd5b5 100644 --- a/test/typeinference/JavaTXCompilerTest.java +++ b/test/typeinference/JavaTXCompilerTest.java @@ -26,8 +26,8 @@ public class JavaTXCompilerTest { @Test public void test() throws IOException, ClassNotFoundException { - //filesToTest.add(new File(rootDirectory+"mathStruc.jav")); - filesToTest.add(new File(rootDirectory+"Lambda.jav")); + filesToTest.add(new File(rootDirectory+"mathStruc.jav")); + //filesToTest.add(new File(rootDirectory+"Lambda.jav")); //filesToTest.add(new File(rootDirectory+"Lambda2.jav")); //filesToTest.add(new File(rootDirectory+"Lambda3.jav")); //filesToTest.add(new File(rootDirectory+"Vector.jav"));