func (ft *FlaggedType) AsType(ctx *CodeGenerationContext) dst.Expr {
	return ft.element.AsType(ctx)
}
AsType renders as a Go abstract syntax tree for a type
(yes this says ast.Expr but that is what the Go 'dst' package uses for types)
package astmodel
import (
	"sort"
	"strings"
	"github.com/dave/dst"
)
type FlaggedType struct {
	element Type
	flags   map[TypeFlag]struct{}
}
var _ Type = &FlaggedType{}
var _ MetaType = &FlaggedType{}
func NewFlaggedType(t Type, flags ...TypeFlag) *FlaggedType {
	result := &FlaggedType{
		element: t,
		flags:   make(map[TypeFlag]struct{}),
	}
	if ft, ok := t.(*FlaggedType); ok {
		result.element = ft.element
		for f := range ft.flags {
			result.flags[f] = struct{}{}
		}
	}
	for _, f := range flags {
		result.flags[f] = struct{}{}
	}
	return result
}
func (ft *FlaggedType) Element() Type {
	return ft.element
}
func (ft *FlaggedType) HasFlag(flag TypeFlag) bool {
	_, ok := ft.flags[flag]
	return ok
}
func (ft *FlaggedType) WithFlag(flag TypeFlag) *FlaggedType {
	return NewFlaggedType(ft, flag)
}
func (ft *FlaggedType) WithoutFlag(flag TypeFlag) Type {
	if !ft.HasFlag(flag) {
		return ft
	}
	if len(ft.flags) == 1 {
		return ft.element
	}
	flags := make(map[TypeFlag]struct{})
	for f := range ft.flags {
		if f != flag {
			flags[f] = struct{}{}
		}
	}
	return &FlaggedType{
		element: ft.element,
		flags:   flags,
	}
}
func (ft *FlaggedType) WithElement(t Type) *FlaggedType {
	var flags []TypeFlag
	for f := range ft.flags {
		flags = append(flags, f)
	}
	return NewFlaggedType(t, flags...)
}
func (ft *FlaggedType) RequiredPackageReferences() *PackageReferenceSet {
	return ft.element.RequiredPackageReferences()
}
func (ft *FlaggedType) References() TypeNameSet {
	return ft.element.References()
}