func BuildOneOfType(types ...Type) Type {
	uniqueTypes := MakeTypeSet()
	for _, t := range types {
		if oneOf, ok := t.(*OneOfType); ok {
			oneOf.types.ForEach(func(t Type, _ int) {
				uniqueTypes.Add(t)
			})
		} else {
			uniqueTypes.Add(t)
		}
	}
	if uniqueTypes.Len() == 1 {
		var result Type
		uniqueTypes.ForEach(func(t Type, _ int) {
			result = t
		})
		return result
	}
	return &OneOfType{uniqueTypes}
}
BuildOneOfType is a smart constructor for a  OneOfType,
maintaining the invariants. If only one unique type
is passed, the result will be that type, not a OneOf.
package astmodel
import (
	"fmt"
	"sort"
	"strings"
	"github.com/dave/dst"
	"github.com/pkg/errors"
)
type OneOfType struct {
	types TypeSet
}
var _ Type = &OneOfType{}