graph icon indicating copy to clipboard operation
graph copied to clipboard

go1.20.5 type problem

Open kangkang333 opened this issue 1 year ago • 4 comments

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]

kangkang333 avatar Jun 14 '23 13:06 kangkang333

Do the new graph versions work for you?

dominikbraun avatar Jul 08 '23 19:07 dominikbraun

The issue persists in 1.21.5

robinje avatar Jan 28 '24 07:01 robinje

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?

dominikbraun avatar Mar 06 '24 08:03 dominikbraun

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.

akzincsystems avatar Mar 31 '24 04:03 akzincsystems