package org.simantics.scl.compiler.internal.codegen.types; import org.simantics.scl.compiler.types.TCon; import org.simantics.scl.compiler.types.TFun; import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.exceptions.MatchException; /** * Type utilites for SCL compiler backend */ public class BTypes { public static final TCon PROC = Types.con(Types.BUILTIN, "Proc"); public static Type[] matchFunction(Type type, int arity) throws MatchException { type = Types.canonical(type); /*while(type instanceof TForAll) type = ((TForAll)type).type;*/ Type[] result = new Type[arity+1]; for(int i=0;i