diff --git a/vector/empty.go b/vector/empty.go index c67594bf4..7b20346e4 100644 --- a/vector/empty.go +++ b/vector/empty.go @@ -21,47 +21,52 @@ func NewEmpty(typ super.Type) *Empty { } func (e *Empty) Kind() Kind { - switch e.typ.(type) { - case *super.TypeOfUint8, *super.TypeOfUint16, *super.TypeOfUint32, *super.TypeOfUint64: - return KindUint - case *super.TypeOfInt8, *super.TypeOfInt16, *super.TypeOfInt32, *super.TypeOfInt64, *super.TypeOfDuration, *super.TypeOfTime: - return KindInt - case *super.TypeOfFloat16, *super.TypeOfFloat32, *super.TypeOfFloat64: - return KindFloat - case *super.TypeOfBool: - return KindBool - case *super.TypeOfBytes: - return KindBytes - case *super.TypeOfString: - return KindString - case *super.TypeOfIP: - return KindIP - case *super.TypeOfNet: - return KindNet - case *super.TypeOfType: - return KindType - case *super.TypeOfNull: - return KindNull - case *super.TypeOfNone: - return KindNone - case *super.TypeRecord: - return KindRecord - case *super.TypeArray: - return KindArray - case *super.TypeSet: - return KindSet - case *super.TypeMap: - return KindMap - case *super.TypeUnion: - return KindUnion - case *super.TypeEnum: - return KindEnum - case *super.TypeError: - return KindError - case *super.TypeFusion: - return KindFusion - default: - panic(sup.String(e.typ)) + typ := e.typ + for { + switch t := typ.(type) { + case *super.TypeOfUint8, *super.TypeOfUint16, *super.TypeOfUint32, *super.TypeOfUint64: + return KindUint + case *super.TypeOfInt8, *super.TypeOfInt16, *super.TypeOfInt32, *super.TypeOfInt64, *super.TypeOfDuration, *super.TypeOfTime: + return KindInt + case *super.TypeOfFloat16, *super.TypeOfFloat32, *super.TypeOfFloat64: + return KindFloat + case *super.TypeOfBool: + return KindBool + case *super.TypeOfBytes: + return KindBytes + case *super.TypeOfString: + return KindString + case *super.TypeOfIP: + return KindIP + case *super.TypeOfNet: + return KindNet + case *super.TypeOfType: + return KindType + case *super.TypeOfNull: + return KindNull + case *super.TypeOfNone: + return KindNone + case *super.TypeRecord: + return KindRecord + case *super.TypeArray: + return KindArray + case *super.TypeSet: + return KindSet + case *super.TypeMap: + return KindMap + case *super.TypeUnion: + return KindUnion + case *super.TypeEnum: + return KindEnum + case *super.TypeError: + return KindError + case *super.TypeFusion: + return KindFusion + case *super.TypeNamed: + typ = t.Type + default: + panic(sup.String(e.typ)) + } } }