mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-30 03:26:47 -05:00
ede5f43204
This is so that we can get the runtime type of a value
30 lines
474 B
Go
30 lines
474 B
Go
package types
|
|
|
|
import (
|
|
"github.com/attic-labs/noms/ref"
|
|
)
|
|
|
|
type Ref struct {
|
|
R ref.Ref
|
|
}
|
|
|
|
func (r Ref) Equals(other Value) bool {
|
|
if other, ok := other.(Ref); ok {
|
|
return r.Ref() == other.Ref()
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (r Ref) Ref() ref.Ref {
|
|
return r.R
|
|
}
|
|
|
|
func (r Ref) Chunks() []Future {
|
|
return nil
|
|
}
|
|
|
|
func (r Ref) TypeRef() TypeRef {
|
|
// TODO: The element type needs to be configurable.
|
|
return MakeCompoundTypeRef("", RefKind, MakePrimitiveTypeRef(ValueKind))
|
|
}
|