graph
graph copied to clipboard
go1.20.5 type problem
Cannot use '&directed[K, T]{ hash: hash, traits: traits, store: store, }' (type *"github.com/dominikbraun/graph".directed[K, T]) as the type *"github.com/dominikbraun/graph".directed[K, T]
Do the new graph versions work for you?
The issue persists in 1.21.5
The issue persists in 1.21.5
@robinje @kangkang333 Interesting that this isn't being catched by the tests, but I would need a more detailed description to reproduce this error. Doesn't v0.23.0 work either?
import (
dbgraph "github.com/dominikbraun/graph"
)
type Template struct {
dbg dbgraph.Graph
}
func (t *Template) DBGraph() {
t.dbg = dbgraph.New(dbgraph.StringHash, dbgraph.Directed(), dbgraph.PreventCycles())
}
Error on build: cannot use generic type graph.Graph[K comparable, T any] without instantiation
. I think this is the same problem as reported by @kangkang333. Using Go V1.21.