]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/utils/ClassBuilder.java
Support for () type in CHR relations
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / codegen / utils / ClassBuilder.java
index 5518cb4878fec54a1d384b406f4d767e169427be..0fe185e611df41ae90efad7e394b77119b0328f4 100644 (file)
@@ -42,6 +42,9 @@ public class ClassBuilder {
             String methodName,
             TypeDesc ret,
             TypeDesc[] params) {
+        for(TypeDesc param : params)
+            if(param.equals(TypeDesc.VOID))
+                throw new IllegalArgumentException();
         MethodVisitor methodVisitor = classVisitor.visitMethod(access, methodName,
                 MethodDesc.forArguments(ret, params).getDescriptor(),
                 null, null);
@@ -68,6 +71,9 @@ public class ClassBuilder {
             String methodName,
             TypeDesc ret,
             TypeDesc[] params) {
+        for(TypeDesc param : params)
+            if(param.equals(TypeDesc.VOID))
+                throw new IllegalArgumentException();
         MethodVisitor methodVisitor = classVisitor.visitMethod(access, methodName,
                 MethodDesc.forArguments(ret, params).getDescriptor(),
                 null, null);
@@ -79,6 +85,9 @@ public class ClassBuilder {
             String methodName,
             TypeDesc ret,
             TypeDesc[] params) {
+        for(TypeDesc param : params)
+            if(param.equals(TypeDesc.VOID))
+                throw new IllegalArgumentException();
         MethodVisitor methodVisitor = classVisitor.visitMethod(access, methodName,
                 MethodDesc.forArguments(ret, params).getDescriptor(),
                 null, null);
@@ -101,6 +110,8 @@ public class ClassBuilder {
 
     public void addField(int access, String fieldName,
             TypeDesc type) {
+        if(type.equals(TypeDesc.VOID))
+            throw new IllegalArgumentException();
         FieldVisitor fieldVisitor = classVisitor.visitField(access, fieldName, type.getDescriptor(), null, null);
         fieldVisitor.visitEnd();
     }