diff --git a/src/de/dhbwstuttgart/strucTypes5/NeueKlassen/ConstructInterfaces.java b/src/de/dhbwstuttgart/strucTypes5/NeueKlassen/ConstructInterfaces.java index 23020760..c25a159a 100644 --- a/src/de/dhbwstuttgart/strucTypes5/NeueKlassen/ConstructInterfaces.java +++ b/src/de/dhbwstuttgart/strucTypes5/NeueKlassen/ConstructInterfaces.java @@ -85,7 +85,6 @@ public class ConstructInterfaces { GenericTypeName typeName = new GenericTypeName( context,name); GenericRefType typeVar = new GenericRefType(typeName, new NullToken()); - formalParameters.add(new FormalParameter(name,typeVar , new NullToken() )); } diff --git a/src/de/dhbwstuttgart/strucTypes5/interfaceTemplates/Interface.java b/src/de/dhbwstuttgart/strucTypes5/interfaceTemplates/Interface.java index 03fcd867..dcae0488 100644 --- a/src/de/dhbwstuttgart/strucTypes5/interfaceTemplates/Interface.java +++ b/src/de/dhbwstuttgart/strucTypes5/interfaceTemplates/Interface.java @@ -53,7 +53,10 @@ public class Interface { @Override public String toString() { - return String.format("interface %s < %s > { \n %s \n %s } \n \n " , strucType , generics, fields.toString() , methods.toString()); + String res = String.format("interface %s < %s > { \n %s \n %s } \n \n " , strucType , generics, fields.toString() , methods.toString()); + res = res.replace("[" , ""); + res = res.replace("]" , ""); + return res; } diff --git a/src/de/dhbwstuttgart/strucTypes6/Main.java b/src/de/dhbwstuttgart/strucTypes6/Main.java new file mode 100644 index 00000000..42886cb3 --- /dev/null +++ b/src/de/dhbwstuttgart/strucTypes6/Main.java @@ -0,0 +1,7 @@ +package de.dhbwstuttgart.strucTypes6; + +/** + * Created by sebastian on 11.05.17. + */ +public class Main { +} diff --git a/test/javFiles/testX.jav b/test/javFiles/testX.jav new file mode 100644 index 00000000..1c8b7b6e --- /dev/null +++ b/test/javFiles/testX.jav @@ -0,0 +1,26 @@ +class Main { +main () { return new MyInteger(); } +} + + +class A { +mt(x,y,z) { return x.sub(y); } +} + +interface TVar_5 < TVar_16, TVar_15 > { + TVar_16 add ( TVar_15 x); + TVar_16 sub ( TVar_15 x); +} + + +class MyInteger implements TVar_5 { + + MyInteger add( MyInteger x ) { + return x; + } + + MyInteger sub( MyInteger x ) { + return x; + } + +} \ No newline at end of file diff --git a/test/strucTypes5/ConvertTest.jav b/test/strucTypes5/ConvertTest.jav index 119a4e56..9b261042 100644 --- a/test/strucTypes5/ConvertTest.jav +++ b/test/strucTypes5/ConvertTest.jav @@ -10,12 +10,17 @@ class A { mt(x,y,z) { return x.sub(y).add(z); } } -interface if1 { +interface TVar_5 < TVar_16, TVar_15 > { -} + TVar_16 add ( TVar_15 x); -class MyInteger { + } + + +class MyInteger implements TVar_5 { + + MyInteger add( MyInteger x ); } diff --git a/test/strucTypes5/ConvertTest.java b/test/strucTypes5/ConvertTest.java index 1b7a846f..c457d7f0 100644 --- a/test/strucTypes5/ConvertTest.java +++ b/test/strucTypes5/ConvertTest.java @@ -57,10 +57,9 @@ public class ConvertTest { ClassOrInterface aClass = sf.getClasses().get(1); - Set typeinfo = new HashSet<>(); - ConstraintSet constraints = sf.getClasses().get(0).getConstraints(new TypeInferenceInformation(typeinfo)); - ConstraintSet cs = constraints; - + //Set typeinfo = new HashSet<>(); + //ConstraintSet constraints = sf.getClasses().get(0).getConstraints(new TypeInferenceInformation(typeinfo)); + //ConstraintSet cs = constraints; AssumptionMap assumptionMap = new AssumptionMap(); diff --git a/test/strucTypes5/ConvertTest2.jav b/test/strucTypes5/ConvertTest2.jav new file mode 100644 index 00000000..67e001a1 --- /dev/null +++ b/test/strucTypes5/ConvertTest2.jav @@ -0,0 +1,11 @@ + + + + + +interface if1 { + +} + + + diff --git a/test/typeinference/JavaTXCompilerTest.java b/test/typeinference/JavaTXCompilerTest.java index 31f0a622..70c0413d 100644 --- a/test/typeinference/JavaTXCompilerTest.java +++ b/test/typeinference/JavaTXCompilerTest.java @@ -17,10 +17,12 @@ public class JavaTXCompilerTest { @Test public void test() throws IOException, ClassNotFoundException { JavaTXCompiler compiler = new JavaTXCompiler(); - compiler.parse(new File(rootDirectory+"Methods.jav")); + compiler.parse(new File(rootDirectory+"testX.jav")); //compiler.parse(new File(rootDirectory+"Generics.jav")); //compiler.parse(new File(rootDirectory+"MethodsEasy.jav")); //compiler.parse(new File(rootDirectory+"Lambda.jav")); compiler.typeInference(); + + } } \ No newline at end of file