From de4cfa26569661fda03e9ae275ed4f2bfaedfa4c Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Tue, 3 Feb 2015 11:20:05 +0100 Subject: [PATCH] =?UTF-8?q?BoGTV=20f=C3=BCgt=20keine=20Constraints=20mehr?= =?UTF-8?q?=20hinzu.=20Test=20angef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../syntaxtree/type/BoundedGenericTypeVar.java | 5 +++-- .../TypeInsertTests/GenericVarTest3.jav | 8 ++++++++ .../TypeInsertTests/GenericVarTest3.java | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 test/plugindevelopment/TypeInsertTests/GenericVarTest3.jav create mode 100644 test/plugindevelopment/TypeInsertTests/GenericVarTest3.java diff --git a/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java b/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java index ebe21b0d8..516abdbed 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java @@ -91,8 +91,9 @@ public class BoundedGenericTypeVar extends GenericTypeVar if(this.bounds != null){ for(Type ev : this.bounds){ ConstraintType extendsType = ass.getTypeFor(ev, this); - //if(extendsType == null)throw new TypeinferenceException("Der Typ "+ev.getName()+" ist nicht korrekt", this); - ret.add(new SingleConstraint(ass.getTypeFor(this, this), extendsType )); + if(extendsType == null)throw new TypeinferenceException("Der Typ "+ev.getName()+" ist nicht korrekt", this); + + //ret.add(new SingleConstraint(ass.getTypeFor(this, this), extendsType )); } } return ret; diff --git a/test/plugindevelopment/TypeInsertTests/GenericVarTest3.jav b/test/plugindevelopment/TypeInsertTests/GenericVarTest3.jav new file mode 100644 index 000000000..06b4a32da --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericVarTest3.jav @@ -0,0 +1,8 @@ +class GenericTest{ + A method(){ + A x; + Integer integer; + x = integer; + return x; + } +} diff --git a/test/plugindevelopment/TypeInsertTests/GenericVarTest3.java b/test/plugindevelopment/TypeInsertTests/GenericVarTest3.java new file mode 100644 index 000000000..431fafa3f --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericVarTest3.java @@ -0,0 +1,16 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class GenericVarTest3 { + private static final String TEST_FILE = "GenericVarTest3.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("Fun1, Object2>, Object1> op"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } +}