Closed bluecivet closed 3 months ago
The issue arises within the type checking process, specifically in the func AssignableTo(V, T Type) bool function, which fails to provide accurate type checks for Named type. .
The function relies on indenticalOrigin to verify the original type. However, the problem lies in its use of the == operator to compare Name structs that include pointers. This comparison method can lead to inaccurate results as it checks memory addresses rather than the actual content of the structs.
Compounding this issue is Wharf's behavior of creating a new package instance each time it filters a configuration. Consequently, pointers within Name structs may differ between package instances.
// identicalOrigin reports whether x and y originated in the same declaration.
func identicalOrigin(x, y *Named) bool {
// TODO(gri) is this correct?
return x.Origin().obj == y.Origin().obj
}
// An object implements the common parts of an Object.
type object struct {
parent *Scope
pos token.Pos
pkg *Package
name string
typ Type
order_ uint32
color_ color
scopePos_ token.Pos
}
Is this fixed @bluecivet ?
Porting https://github.com/onsi/ginkgo.git using Wharf but I get
However, the error causes it to look unreasonable
This looks like a type mismatch, but the type is correct.
The same thing happens when porting https://github.com/u-root/u-root.git