mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-24 19:48:41 -05:00
3ff6ee6add
Struct type definition is now inlined into the chunk. To break cycles we use back references. - Removes unresolved type refs - Removes packages Fixes #1164 Fixes #1165
28 lines
629 B
Go
28 lines
629 B
Go
package pkg
|
|
|
|
import "github.com/attic-labs/noms/types"
|
|
|
|
const UnresolvedKind = 100
|
|
|
|
// UnresolvedDesc represents a named reference to a type.
|
|
type UnresolvedDesc struct {
|
|
Namespace string
|
|
Name string
|
|
}
|
|
|
|
func (desc UnresolvedDesc) Kind() types.NomsKind {
|
|
return UnresolvedKind
|
|
}
|
|
|
|
func (desc UnresolvedDesc) Equals(other types.TypeDesc) bool {
|
|
if other.Kind() != UnresolvedKind {
|
|
return false
|
|
}
|
|
d2 := other.(UnresolvedDesc)
|
|
return d2.Namespace == desc.Namespace && d2.Name == desc.Namespace
|
|
}
|
|
|
|
func makeUnresolvedType(namespace, name string) *types.Type {
|
|
return &types.Type{Desc: UnresolvedDesc{namespace, name}}
|
|
}
|