Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 46 additions & 41 deletions vector/empty.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}

Expand Down
Loading