public static IScriptType wrapSingleReturnTypes(List<ReturnType> types) { List<IScriptType> result = Lists.newArrayList(); for (ReturnType t : types) result.add(SingleReturnType.valueOf(t)); return new TupleType(result); }
public static IScriptType createFromReturn(List<ReturnType> types) { if (types.size() == 0) { return SingleType.VOID; } else if (types.size() == 1) { return SingleReturnType.valueOf(types.get(0)); } else { return wrapSingleReturnTypes(types); } }
public static IScriptType single(ReturnType type, IRange range) { Preconditions.checkNotNull(type); Preconditions.checkNotNull(range); return new BoundedType(SingleReturnType.valueOf(type), range); }
public static IScriptType single(ReturnType type) { return SingleReturnType.valueOf(type); }