Files
dolt/types/ref.go
T
Erik Arvidsson ede5f43204 Value should also have a TypeRef
This is so that we can get the runtime type of a value
2015-09-30 16:15:13 -04:00

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))
}