You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should be fixed on master. I'd like to wait a day or two, to see if this change has caused any new bugs. If it hasn't, I'll make a new patch release.
It seems to still be broken on some cases with generics. This reports bar is unused:
package baz
// Result is a generic type that represents the result of a function calltypeResult[Tany] struct {
ValueTErrorerror
}
// Foo is an interface that defines the bar methodtypeFoo[Tany] interface {
bar() Result[T]
}
// Bar is a function that takes a Foo and calls its bar methodfuncBar[Tany](fFoo[T]) Result[T] {
returnf.bar()
}
// Buzz is a struct that implements the Foo interfacetypeBuzz[Tany] struct {
valueT
}
func (b*Buzz[T]) bar() Result[T] {
returnResult[T]{Value: b.value}
}
while
package baz
// Foo is an interface that defines the bar methodtypeFoo[Tany] interface {
bar() T
}
// Bar is a function that takes a Foo and calls its bar methodfuncBar[Tany](fFoo[T]) T {
returnf.bar()
}
// Buzz is a struct that implements the Foo interfacetypeBuzz[Tany] struct {
valueT
}
func (b*Buzz[T]) bar() T {
returnb.value
}
Activity
dominikh commentedon Mar 5, 2021
Can reproduce, looking into it.
dominikh commentedon Mar 5, 2021
This should be fixed on master. I'd like to wait a day or two, to see if this change has caused any new bugs. If it hasn't, I'll make a new patch release.
hiromoon commentedon Mar 5, 2021
I see! Thank you for quick response!
unused: revert to using a typeutil.Map
unused: revert to using a typeutil.Map
ngotchac commentedon Oct 21, 2025
It seems to still be broken on some cases with generics. This reports
baris unused:while
works fine (returns
Tinstead ofResult[T]).